Hello,
We've been trying hard to install an Unreal plugin built by ourselves into Aximmetry, but we've been having lots of problems with the compiler failing to link it correctly using Unreal for Aximmetry, even though in Epic's Unreal Engine the plugin could be built without any problems and it's working.
Here's an example of the first two lines of the LNK errors, it's in Spanish but they are the usual LNK2019 Unresolved External Symbol messages by MSVC:
LogAximmetry: Display: UnrealBuildTool: Module.BPImportDLL.cpp.obj : error LNK2019: s?mbolo externo "__declspec(dllimport) class UPackage * __cdecl GetTransientPackage(void)" (__imp_?GetTransientPackage@@YAPEAVUPackage@@XZ) sin resolver al que se hace referencia en la funci?n "public: static class UObject * __cdecl AActor2DLL::__VTableCtorCaller(class FVTableHelper &)" (?__VTableCtorCaller@AActor2DLL@@SAPEAVUObject@@AEAVFVTableHelper@@@Z)
LogAximmetry: Display: UnrealBuildTool: Module.BPImportDLL.cpp.obj : error LNK2019: s?mbolo externo "__declspec(dllimport) class UObject * __cdecl StaticAllocateObject(class UClass const *,class UObject *,class FName,enum EObjectFlags,enum EInternalObjectFlags,bool,bool *,class UPackage *)" (__imp_?StaticAllocateObject@@YAPEAVUObject@@PEBVUClass@@PEAV1@VFName@@W4EObjectFlags@@W4EInternalObjectFlags@@_NPEA_NPEAVUPackage@@@Z) sin resolver al que se hace referencia en la funci?n "public: static void * __cdecl AActor2DLL::operator new(unsigned __int64,enum EInternal,class UObject *,class FName,enu
m EObjectFlags)" (??2AActor2DLL@@SAPEAX_KW4EInternal@@PEAVUObject@@VFName@@W4EObjectFlags@@@Z)
We've traced the problem to be in a setting defined in "UnrealGamePlugin.Target.cs" (Aximmetry DE/UnrealEngine/Engine/). If we comment the line "LinkType = TargetLinkType.Modular;", the plugin links and works without any problem, as it would do in Unreal.
What is the root of this problem? Is it something in the machine this is being worked on? Do we need to change anything in our end? We would prefer to leave Aximmetry settings as default so we don't have to document and replicate the changes for every machine working with Aximmetry.
Cheers
Hi,
You need to build in Modular otherwise no plugin DLLs will be created. These DLLs are loaded when using Aximmetry in cooked mode.
Linker errors are usually caused by missing dependencies in the plugin's Build.cs file.
In your case, the GetTransientPackage function is not found by the linker. You can find this function in the CoreUObject module's code.
So you need to add the CoreUObject as a dependency in your BPImportDLL.Build.cs file by adding the following line:
PrivateDependencyModuleNames.Add("CoreUObject");
After this, we think your plugin should build without a problem.
Warmest regards,