Linker error with C++ std lib on Linux

anonymous_user_4a1407a3
Wed, 21 Jun 2017 05:49:55 +0000
Platform & Builds

I am trying to include a library of my own functions in my Unreal project. I can successfully link the library dynamically, however attempting to use any functions which utilise std::string and other parts of the standard library cause a linker error ( undefined reference). Linking statically causes a similar error, regardless of whether the functions are used or not.

The library is built with Qt Creator (no Qt libraries though), and is linked against libstdc++ (tested with both clang and g++).

As far as I can tell, Unreal is trying to use the packaged libc++ instead of libstdc++. Searching online suggests setting a variable called UE4_LINUX_USE_LIBCXX to 0 somewhere, but I cannot find any details on how to do this.

Is this the correct approach to be taking, and if so, how/where do I set this variable?

2 posts - 1 participant