I compiled the project and it compiled fine, but when running it would fail and say the library was missing. After digging around I put the library in the Binaries folder and that solved the problem.
But even after compiling and finding the library, during UE4 is starting up it fails with the above error…
./UE4Editor: symbol lookup error: /home/ricardo/Documents/UnrealProjects/DivisactionIntg2/Binaries/Linux/libUE4Editor-DivisactionIntg2.so: undefined symbol: _ZN11Divisaction5DTime17setTimeCalculatorENSt3__110shared_ptrINS_15DTimeCalculatorEEE
You might be affected by a bug with how UBT calculates RPATH for the libraries. In Engine/Sources/Programs/UnrealBuildTool/Linux/LinuxToolchain.cs, try replacing line 1117 (or so) with
string RelativePath = new FileReference(AdditionalLibrary).Directory.MakeRelativeTo(OutputFile.Reference.Directory);
Thank you for the reply. Your solution removes the need to copy and paste the library in the binaries, but the last problem persists. It seems it can’t find the implementation of a function.
If the libDivisaction.so library is found (you can double check with running
ldd libUE4Editor-DivisactionIntg2.so
it should not have “not found” but instead point to libDivisaction.so), make sure that it contains the text for Divisaction::DTime::setTimeCalculator() function. You can run
nm --demangle libDivisaction.so
and grep for that function name. It should say “t” and not “U” next to it.
It doesn’t seem to have the library on the output of ldd…
$ ldd libUE4Editor-DivisactionIntg2.so
linux-vdso.so.1 => (0x00007ffd77466000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f032bbc1000)
libUE4Editor-Engine.so => not found
libUE4Editor-AIModule.so => not found
libUE4Editor-Core.so => not found
libUE4Editor-CoreUObject.so => not found
libUE4Editor-UMG.so => not found
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f032b8b6000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f032b4ef000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f032b2d8000)
/lib64/ld-linux-x86-64.so.2 (0x0000558781bf5000)
The only solution I found is to copy paste the code into a UE4 Plugin and compile it from there.
Basically, unless you have a extern “C” library (which I don’t), the library needs to be compiled using the same libraries as the engine. (aka compatibility issues…)