I’m linking in a dll in c++ though edits in MyProject.Build.cs. I ended up with this though looking at various posts here:
PublicAdditionalLibraries.Add(Path.Combine(PathToThirdPartyLibrariesFolder, "MyLinkedLibrary.lib"));
CopyToBinaries(@"ThirdParty\MyLinkedLibrary\Libraries\MyLinkedLibrary.dll", Target);
RuntimeDependencies.Add(new RuntimeDependency("$(ProjectDir)/Binaries/Win64/MyLinkedLibrary.dll"));
PublicIncludePaths.Add(Path.Combine(PathToThirdPartyFolder, "MyLinkedLibrary", "Includes"));
and it works great.
However, I tried to add a new function to my linked library :
int MyNamespace::TestFunction() const
{
return 4;
}
which is pretty simple compared to other functions I have successfully exported. Now, however, when I try to run game and/or Editor from VisualStudio I get error
The procedure entry point ?TestFunction@MyObject@MyNamespace@QEBAHXZ could not be located in the dynamic link library C:.…\Binaries\Win64\UE4Editor-MyProject.dll
Note that MyProject compiles in Visual Studio.
MyProject compiles and runs fine if I ommit the line
int x = myObject_->TestFunction();
I also have a separate c++ project that tests MyLinkedLibrary.dll by calling the same function and it works fine.
I’ve also double cheked that …MyProject.dll and MyLinkedLibrary.dll are compiled for x64.
Any ideas?