SObjectPropertyEntryBox Linker Error: LNK2019

Hey,

when I try to use the SObjectPropertyEntryBox (in my Unreal Engine 5.1 C++ project) I get the linker error LNK2019. With the explanation that the linker can not resolve the extern Symbol: "__declspec(dllimport) public: void __cdecl SObjectPropertyEntryBox::Construct(struct SObjectPropertyEntryBox::FArguments const &)" (__imp_?Construct@SObjectPropertyEntryBox@@QEAAXAEBUFArguments@1@@Z)".

My code looks something like this:

#include "MyClass.h"
#include "PropertyCustomizationHelpers.h"
void MyClass::MyMethod()
{
  ..
  TSharedRef<SWindow> Window = SNew(SWindow)
    .Content()
    [
      SNew(SVerticalBox)
      + SVerticalSlot::Slot()
      [
        SNew(SObjectPropertyEntryBox)
	.AllowedClass(AActor::StaticClass())
        .OnObjectChanged_Raw(this, &MyClass::MyMethod2)
      ]
    ];
  ...
}

I am using a Blank Unreal Engine 5.1 project and created within this project a new plugin based on the Editor Standalone Window template.

Thanks for reading. I hope you can help me :slight_smile:

Have you included PropertyEditor in your module file? If not, this is probably a cause of problem. (I guess you did, coz it’s an obvious one but still worth asking :v )

1 Like

No I didn’t . I am pretty new to Unreal and even newer to the cpp API of Unreal and because of that I have a lot of problems with the lacking documentation.
I just looked up how I could achive something like the SObjectPropertyEntryBox and after I didn’t find any tutorials for it. I used the native Unreal documentation and the only thing I found there was the #include "PropertyCustomizationHelpers.h".

Thanks to your comment I solved the issue, but how should I get that from the documentation?

Linker errors can be caused by multiple things.

Unreal works in the way that it structures its source code under separate modules (your project is a module too), so it can save compile times and binary size. If you want to use a class from a different module within other module, you have to include it so the linker will find it.

If specific function call gives you the same Linker error and you don’t know which module to use, just search for it, Unreal API Reference should have it listed.
In your case it was - SObjectPropertyEntryBox::Construct | Unreal Engine Documentation - so its module is:

1 Like

Thanks a lot for this detailed explanation and sorry for wasting your time. Have a nice day! :slight_smile:

1 Like