x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Errors when Declaring TAssetPtr

I am trying to declare a UWorld property so that I can setup a Level asset selector, but when I try to declare the UWorld property like below I get errors:

 UPROPERTY(EditAnywhere, BlueprintReadOnly)
         TAssetPtr<UWorld> WorldTest;

The full h is here:

 #pragma once
 
 #include "Internationalization/Text.h"
 #include "UObject/Object.h"
 #include "UObject/ObjectMacros.h"
 
 #include "BatchAsset.generated.h"
 
 UCLASS(BlueprintType, hidecategories=(Object))
 class BATCHASSET_API UBatchAsset : public UObject
 {
     GENERATED_BODY()
 
 public:
 
     UPROPERTY(EditAnywhere, BlueprintReadOnly)
         TAssetPtr<UWorld> WorldTest;
 };

The error in the output log is as follows:

 Creating library E:\Github\BatchRendering\BatchProject\Plugins\BatchRender\Intermediate\Build\Win64\UE4Editor\Development\BatchAsset\UE4Editor-BatchAsset.suppressed.lib and object E:\Github\BatchRendering\BatchProject\Plugins\BatchRender\Intermediate\Build\Win64\UE4Editor\Development\BatchAsset\UE4Editor-BatchAsset.suppressed.exp
 1>Module.BatchAsset.gen.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class UClass * __cdecl Z_Construct_UClass_UWorld_NoRegister(void)" (__imp_?Z_Construct_UClass_UWorld_NoRegister@@YAPEAVUClass@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static struct UE4CodeGen_Private::FObjectPropertyParams const Z_Construct_UClass_UBatchAsset_Statics::NewProp_WorldTest''(void)" (??__E?NewProp_WorldTest@Z_Construct_UClass_UBatchAsset_Statics@@2UFObjectPropertyParams@UE4CodeGen_Private@@B@@YAXXZ)
 1>E:\Github\BatchRendering\BatchProject\Plugins\BatchRender\Binaries\Win64\UE4Editor-BatchAsset.dll : fatal error LNK1120: 1 unresolved externals

I'm not even up to trying to set the UWorld parameter in the Slate Widget cause I can't get this to declare the variable in the asset.

Product Version: UE 4.21
Tags:
more ▼

asked Mar 07 '19 at 05:11 PM in C++ Programming

avatar image

Miroac
728 20 25 108

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question