Error LNK2019 : unresolved external symbol Error

I’m an experienced programmer new to Unreal and C++ programming. I’m getting this link error and I can’t figure out what I’m doing wrong.

Error LNK2019 : unresolved external symbol "public: void __cdecl FAddUnrealObjectsModule::JeffTestMessage(void)

It has a module called “TabbedDialog” with buttons to add Unreal objects such as cameras, lights, and other things. It runs fine by itself. I want the buttons to call functions on another Module called “AddUnrealObjects”.

When I try and complete the project I get the LNK2019 error above. It seems like “TabbedDialog” can’t see the "AddUnrealObjects module.

Here is how my project is laid out in JetBrains

Here is my FimTest.Uproject file.

Here is the include section of the TabbedDialog.cpp file

Here are the includes for the “AddUnrealObjects.cpp”

Finaly here is the FimTest9.Build.cs file

And here is the calling function on the ButtonClick

FReply FTabbedDialogModule::OnNewCameraButtonClicked()
{
if (FModuleManager::Get().IsModuleLoaded(“AddUnrealObjects”))
{
UE_LOG(LogTemp, Error, TEXT(“AddUnrealObjects module IS loaded”));
FAddUnrealObjectsModule& AddUnrealObjectsModule = FModuleManager::LoadModuleChecked(“AddUnrealObjects”);
AddUnrealObjectsModule.AddCineCamera();
}

I’ve spent two days trying to figure this out. Any help would be appreciated.

–Jeff

Maybe I missed it from your Screenshots, but does the TabbedDialog.Build.cs also have the AddUnrealObjects Module added as a Dependency?

If I had to guess (since you don’t show enough in the snippets), you don’t have a ADDUNREALOBJECTS_API macro applied to your FAddUnrealObjectsModule class or the JeffTestMessage function. This macro is required to call functions or access variables across DLL boundaries like you have here with TabbedDialog trying to use code from AddUnrealObjects.

2 Likes

Yes, it does. Thanks so much for looking at my issue.

Wow, that worked. I would never have figured that out! I really appreciate your help.

Thanks,
Jeff

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.