I am trying to extend the functionality of the UImage
widget, only a simple change to autoset the brush based on an id property.
However whenever I try to derive my own class from UImage
I get a wall of linker errors, the 1st of these is claiming unresolved symbol for UImage::UImage
. From this I assumed I had to implement a constructor in my own class and include the UImage
constructor in the chain passing the FObjectInitializer
into that. Doing this makes no difference at all to the linker errors!?
Am I missing something?
UCLASS()
class FLUIDMOVEMENT_API UButtonIcon : public UImage
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FName actionId;
UButtonIcon(const FObjectInitializer & objInit) : UImage(objInit) {};
};
and the error (snipped) is:
ButtonIcon.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl UImage::UImage(class FObjectInitializer const &)" (__imp_??0UImage@@QEAA@AEBVFObjectInitializer@@@Z) referenced in function "public: __cdecl UButtonIcon::UButtonIcon(class FObjectInitializer const &)" (??0UButtonIcon@@QEAA@AEBVFObjectInitializer@@@Z)
2>ButtonIcon.gen.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl UImage::UImage(class FObjectInitializer const &)" (__imp_??0UImage@@QEAA@AEBVFObjectInitializer@@@Z)
2>ButtonIcon.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl UImage::~UImage(void)" (__imp_??1UImage@@UEAA@XZ) referenced in function "public: virtual __cdecl UButtonIcon::~UButtonIcon(void)" (??1UButtonIcon@@UEAA@XZ)
2>ButtonIcon.gen.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl UImage::~UImage(void)" (__imp_??1UImage@@UEAA@XZ)
2>ButtonIcon.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UVisual::BeginDestroy(void)" (?BeginDestroy@UVisual@@UEAAXXZ)
and so on for other methods of `UImage`.