Hello,
I am trying to make a little plugin to add the leveldb library to ue4 for use in game (with the snappy optional dependency). **I have it working on windows after building the static .libs with VS. **
I would really like to support linux and mac platforms so I need to build the .a static libraries. I’ve tried doing this by spinning up an Ubuntu machine, installing clang and compiling it as per the github page and I get the libraries but I am unable to link these on my windows machine (I assume because its not exactly the same compiler).
The errors I get are:
1> C:/UnrealToolchains/v13_clang-7.0.1-centos7/x86_64-unknown-linux-gnu/bin\x86_64-unknown-linux-gnu-ld: C:/Users/Admin/Documents/Unreal Projects/leveldb/Plugins/LDBPlugin/Source/ThirdParty/leveldb/lib\libleveldb.a(env_posix.cc.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
1> C:/UnrealToolchains/v13_clang-7.0.1-centos7/x86_64-unknown-linux-gnu/bin\x86_64-unknown-linux-gnu-ld: C:/Users/Admin/Documents/Unreal Projects/leveldb/Plugins/LDBPlugin/Source/ThirdParty/leveldb/lib\libleveldb.a(comparator.cc.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
1> C:/UnrealToolchains/v13_clang-7.0.1-centos7/x86_64-unknown-linux-gnu/bin\x86_64-unknown-linux-gnu-ld:
If I understand correctly this is because ue4 wants to make these modules into DLLs. I have tried to recompile with -fPIC however I am not great with cmake so I may have not done so properly.
Does anyone have any experience getting this type of thing to work? I have seen a few other references to this issue but unfortunately none of these mentions led me any where. It looks like using the toolchain from the commandline is an option but I assume I am not nearly familiar enough with cmake to be able to replicate all the build steps for leveldb.
Any suggestions would be greatly appreciated. Thank you!