Unreal Project compiling issues on Linux UE4Editor

Hello,

I’ve posted this on the unreal forum already, but didn’t get an answer yet. So I hope that here’s someone who could help me.

I’m trying to compile my project on UE4Editor for Linux and get the error message when creating the libUE4Editor-Unreal_Project.so:

ThirdParty/orbitTools/lib/libcore.a(cJulian.cpp.o): relocation R_X86_64_32 against `.rodata’ can not be used when making a shared object; recompile with -fPIC

However cross compiling the same project with Visual Studio using the proposed toolchain clang-3.5.0-x86 does work also packaging the project using the UE4Editor on Windows works and most importantly the packed Game works on Linux.
Nevertheless I’d like to be able to use the Linux native UE4Editor to edit and compile the project…

Setup:

Cross compile chain
Win7 64bit, Visual Studio 2015, v4_clang-3.5.0_ld-2.24_glibc-2.12.2, UE4Editor 4.10.4 compiled in Visual Studio 2015 for Windows + Linux

Linux
Ubuntu 14.04.4 x86-64, UE4Editor 4.10.4, gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1), all dependencies installed according to A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

ThirdParty library is build on the same Linux simply using cmake without any specific flags etc.

I know it might be specific to the thirds party library but the thing I don’t get is why would it compile with the same library on Windows using the cross compile change but not on Linux. Using the proposed “-fPIC” may not help because it does compile on Windows without it… Or is it specific to the Linux UE4Editor?

Many thanks in advance

From our experimentation, when you build the editor in linux unrealbuilttool builds dynamic libraries. This is also the case in windows editor build.

When you build the game, everything is built statically.

The problem you are encountering is that you are trying to build a dynamic library which links a static library. This static library cannot be used inside a shared library.

We also had the same issue and we are working to get the source for the thirdparty library to better understand how the library needs to be built to work.

Hi, I haven’t tried again since we’ve dropped the linux support due to another bug by the unreal engine → Unreal Engine Issues and Bug Tracker (UE-31232)

But thanks for the feedback. Anyhow the Windows Build for Linux was working till some point (until we got the other issue).

Hey Geekazoid, I’m seeing the same thing in a different place using UE15.3, & Scaleform 4.6.33. Did you ever find a fix?

Actually the issue was indeed the -fPIC compile option on the ThirdParty Library just couldn’t figure our how to set it correctly:
simply

export CXXFLAGS=“-fPIC”
before running make does the trick