I’ve been trying to instantiate UMaterialExpressionSubtract from editor plugin and have been unable to do so due to linker error:
error LNK2019: unresolved external symbol "private: static class UClass * __cdecl UMaterialExpressionSubtract::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@UMaterialExpressionSubtract@@CAPEAVUClass@@PEB_W@Z) referenced in function "public: static class UClass * __cdecl UMaterialExpressionSubtract::StaticClass(void)" (?StaticClass@UMaterialExpressionSubtract@@SAPEAVUClass@@XZ)
I’ve investigated the header and foudn out that its UCLASS macro is missing MinimalAPI keyword. That’s probably the cause of this problem.
Example:
MaterialExpressionAdd:
UCLASS(MinimalAPI)
class UMaterialExpressionAdd : public UMaterialExpression
{
MaterialExpressionMultiply:
UCLASS(MinimalAPI)
class UMaterialExpressionMultiply : public UMaterialExpression
{
MaterialExpressionSubtract:
UCLASS()
class UMaterialExpressionSubtract : public UMaterialExpression
{
I’m using Windows 7 64bit, with unreal engine 4.10.1