I was writing a struct named “FPickableItemDisplayData”
Here is the C++ .h file:
#pragma once
#include "Components/Image.h"
#include "PickableItemDisplayData.generated.h"
USTRUCT(BlueprintType)
struct FPickableItemDisplayData
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere)
UImage* Image;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FText Title;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FText Description;
};
You can see that there is a “UImage*” class property inside, with UPROPERTY, and it generates the following error when building project:
unresolved external symbol "__declspec(dllimport) class UClass * __cdecl Z_Construct_UClass_UImage_NoRegister(void)" (__imp_?Z_Construct_UClass_UImage_NoRegister@@YAPEAVUClass@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static struct UE4CodeGen_Private::FObjectPropertyParams const Z_Construct_UScriptStruct_FPickableItemDisplayData_Statics::NewProp_Image''(void)" (??__E?NewProp_Image@Z_Construct_UScriptStruct_FPickableItemDisplayData_Statics@@2UFObjectPropertyParams@UE4CodeGen_Private@@B@@YAXXZ)
It seems that this action causes a link failure. And when I delete the “UPROPERTY()” declaration above the UImage*, the compilation went fine but it wasn’t what I want for,
Did anyone know how to resolve this problem?