I’m trying to create a custom animation node. The node worked fine all was nice, however, when packaging the game, it failed since I can’t refer to editor modules in the final game. I decided to split it into two modules:
Mati - the main game
SparkEditor - the editor part
And have two targets, one for the editor, and one for the runtime.
I changed the .uproject file to have the modules:
"Modules": [
{
"Name": "Mati",
"Type": "Runtime",
"LoadingPhase": "Default"
},
{
"Name": "SparkEditor",
"Type": "Editor",
"LoadingPhase": "Default"
}
],
And implemented both modules. The structure is this:
The AnimNode_SparkDialog.h is:
USTRUCT()
struct MATI_API FAnimNode_SparkDialog : public FAnimNode_SequencePlayer
{
GENERATED_BODY()
public:
// FAnimNode_Base
// Register the animation node with the quest tracker.
virtual void UpdateAssetPlayer(const FAnimationUpdateContext& Context) override;
// end FAnimNode_Base
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Runtime, meta=(AlwaysAsPin))
USparkDialogSpeechSupport* SparkDialogSpeech;
};
It has the MATI_API macro that if I understood correctly gets translated to __cdecl and dllexport.
Similarly, in the AnimGraphNode_SparkDialog:
UCLASS()
class SPARKEDITOR_API UAnimGraphNode_SparkDialog : public UAnimGraphNode_Base
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, Category = Settings)
FAnimNode_SparkDialog Node;
virtual FLinearColor GetNodeTitleColor() const override;
virtual FText GetTooltipText() const override;
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
virtual FText GetMenuCategory() const override;
};
However when building it, compilation is fine, however I get:
CompilerResultsLog: New page: Compilation - 10.11.2021, 00:55:32
CompilerResultsLog: Using 'git status' to determine working set for adaptive non-unity build (C:\projects\unreal\Mati).
CompilerResultsLog: Building Mati...
CompilerResultsLog: Using Visual Studio 2019 14.28.29914 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
CompilerResultsLog: Building 9 actions with 8 processes...
CompilerResultsLog: [1/9] UE4Editor-SparkEditor-0051.lib
CompilerResultsLog: Bibliothek "C:\projects\unreal\Mati\Intermediate\Build\Win64\UE4Editor\Development\SparkEditor\UE4Editor-SparkEditor-0051.lib" und Objekt "C:\projects\unreal\Mati\Intermediate\Build\Win64\UE4Editor\Development\SparkEditor\UE4Editor-SparkEditor-0051.exp" werden erstellt.
CompilerResultsLog: [2/9] UE4Editor-ArticyEditor-0051.lib
CompilerResultsLog: Bibliothek "C:\projects\unreal\Mati\Plugins\ArticyImporter\Intermediate\Build\Win64\UE4Editor\Development\ArticyEditor\UE4Editor-ArticyEditor-0051.lib" und Objekt "C:\projects\unreal\Mati\Plugins\ArticyImporter\Intermediate\Build\Win64\UE4Editor\Development\ArticyEditor\UE4Editor-ArticyEditor-0051.exp" werden erstellt.
CompilerResultsLog: [3/9] UE4Editor-Mati-2106.lib
CompilerResultsLog: Bibliothek "C:\projects\unreal\Mati\Intermediate\Build\Win64\UE4Editor\Development\Mati\UE4Editor-Mati-2106.lib" und Objekt "C:\projects\unreal\Mati\Intermediate\Build\Win64\UE4Editor\Development\Mati\UE4Editor-Mati-2106.exp" werden erstellt.
CompilerResultsLog: [4/9] UE4Editor-ArticyRuntime-0051.lib
CompilerResultsLog: Bibliothek "C:\projects\unreal\Mati\Plugins\ArticyImporter\Intermediate\Build\Win64\UE4Editor\Development\ArticyRuntime\UE4Editor-ArticyRuntime-0051.lib" und Objekt "C:\projects\unreal\Mati\Plugins\ArticyImporter\Intermediate\Build\Win64\UE4Editor\Development\ArticyRuntime\UE4Editor-ArticyRuntime-0051.exp" werden erstellt.
CompilerResultsLog: [5/9] UE4Editor-SparkEditor-0051.dll
CompilerResultsLog: Bibliothek "C:\projects\unreal\Mati\Intermediate\Build\Win64\UE4Editor\Development\SparkEditor\UE4Editor-SparkEditor-0051.suppressed.lib" und Objekt "C:\projects\unreal\Mati\Intermediate\Build\Win64\UE4Editor\Development\SparkEditor\UE4Editor-SparkEditor-0051.suppressed.exp" werden erstellt.
CompilerResultsLog: Error: AnimGraphNode_SparkDialog.cpp.obj : error LNK2019: Verweis auf nicht aufgel?stes externes Symbol ""__declspec(dllimport) public: __cdecl FAnimNode_SparkDialog::FAnimNode_SparkDialog(void)" (__imp_??0FAnimNode_SparkDialog@@QEAA@XZ)" in Funktion ""public: __cdecl UAnimGraphNode_SparkDialog::UAnimGraphNode_SparkDialog(class FObjectI
nitializer const &)" (??0UAnimGraphNode_SparkDialog@@QEAA@AEBVFObjectInitializer@@@Z)".
CompilerResultsLog: Error: AnimGraphNode_SparkDialog.gen.cpp.obj : error LNK2001: Nicht aufgel?stes externes Symbol ""__declspec(dllimport) public: __cdecl FAnimNode_SparkDialog::FAnimNode_SparkDialog(void)" (__imp_??0FAnimNode_SparkDialog@@QEAA@XZ)".
CompilerResultsLog: Error: AnimGraphNode_SparkDialog.cpp.obj : error LNK2019: Verweis auf nicht aufgel?stes externes Symbol ""__declspec(dllimport) public: virtual __cdecl FAnimNode_SparkDialog::~FAnimNode_SparkDialog(void)" (__imp_??1FAnimNode_SparkDialog@@UEAA@XZ)" in Funktion ""public: virtual __cdecl UAnimGraphNode_SparkDialog::~UAnimGraphNode_SparkDia
log(void)" (??1UAnimGraphNode_SparkDialog@@UEAA@XZ)".
CompilerResultsLog: Error: AnimGraphNode_SparkDialog.gen.cpp.obj : error LNK2001: Nicht aufgel?stes externes Symbol ""__declspec(dllimport) public: virtual __cdecl FAnimNode_SparkDialog::~FAnimNode_SparkDialog(void)" (__imp_??1FAnimNode_SparkDialog@@UEAA@XZ)".
CompilerResultsLog: Error: C:\projects\unreal\Mati\Binaries\Win64\UE4Editor-SparkEditor-0051.dll : fatal error LNK1120: 2 nicht aufgel?ste Externe
CompilerResultsLog: [6/9] UE4Editor-ArticyRuntime-0051.dll
CompilerResultsLog: Bibliothek "C:\projects\unreal\Mati\Plugins\ArticyImporter\Intermediate\Build\Win64\UE4Editor\Development\ArticyRuntime\UE4Editor-ArticyRuntime-0051.suppressed.lib" und Objekt "C:\projects\unreal\Mati\Plugins\ArticyImporter\Intermediate\Build\Win64\UE4Editor\Development\ArticyRuntime\UE4Editor-ArticyRuntime-0051.suppressed.exp" werde
n erstellt.
CompilerResultsLog: [7/9] UE4Editor-Mati-2106.dll
CompilerResultsLog: Bibliothek "C:\projects\unreal\Mati\Intermediate\Build\Win64\UE4Editor\Development\Mati\UE4Editor-Mati-2106.suppressed.lib" und Objekt "C:\projects\unreal\Mati\Intermediate\Build\Win64\UE4Editor\Development\Mati\UE4Editor-Mati-2106.suppressed.exp" werden erstellt.
CompilerResultsLog: [8/9] UE4Editor-ArticyEditor-0051.dll
CompilerResultsLog: Bibliothek "C:\projects\unreal\Mati\Plugins\ArticyImporter\Intermediate\Build\Win64\UE4Editor\Development\ArticyEditor\UE4Editor-ArticyEditor-0051.suppressed.lib" und Objekt "C:\projects\unreal\Mati\Plugins\ArticyImporter\Intermediate\Build\Win64\UE4Editor\Development\ArticyEditor\UE4Editor-ArticyEditor-0051.suppressed.exp" werden er
stellt.
There’s no constructor/virtual destructor defined, but even if I do define them manually in the AnimNode_SparkDialog, I get the same errors.
I’m at a loss on what to do next. Any suggestions would be greatly appreciated.
Also, a side note, for me it’s unclear how targets are linked to the uproject file, since the uproject simply contains the modules list. Does that mean the uproject is always the editor target? Are targets supposed to be used for some external tooling?


