LNK 2019 error when declaring new object

When I try to declare a new object “UEmergencyEvent” I get this LNK 2019 error:

unresolved external symbol "private: static class UClass * __cdecl UEmergencyEvent::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@UEmergencyEvent@@CAPEAVUClass@@XZ) referenced in function "class UEmergencyEvent * __cdecl NewObject<class UEmergencyEvent>(class UObject *)" (??$NewObject@VUEmergencyEvent@@@@YAPEAVUEmergencyEvent@@PEAVUObject@@@Z)

I can access existing UEmergencyEvent objects, its just creating new ones that is causing issues.

Hello @JPVertex

I pulled some information from another thread as this type of issue had came up previously on other threads. Here’s a link to that post. They were able to explain the LNK2019 issue, it’s cause, and a solution to fixing it. Let’s start there. Let me know if that helps clear up the problem. If not, we can look into alternative solution.

I have already added “ICDCIPlugin” to the dependency module in my build.cs. The classes from InterfaceWrapper.h are accessible, I just can’t seem to declare new objects from the header file.

build.cs

public class JMInstructorStation : ModuleRules
{
	public JMInstructorStation(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
	
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

		PrivateDependencyModuleNames.AddRange(new string[] {  "ICDCIPlugin" });
		PrivateIncludePathModuleNames.AddRange(new string[] {  "ICDCIPlugin" });
		PrivateIncludePaths.AddRange(new string[] { "ICDCIPlugin/Public", "ICDCIPlugin/Classes", "ICDCIPlugin/Private" });
	}
}

@FrostyJas I still haven’t been able to resolve this issue. Do you have any other suggestions?

Hi @JPVertex

I’m sorry to hear that you’re still having issues with this. This may be something within the generated.inl that is causing it. Take a look here and see if this better explains it. (I’ll keep up to date on this post and ensure we can find a solution if this does not help)