Using C++ 5.3 - undefined symbols
Added by Nicole King over 9 years ago
If, like me, you're using Arch Linux, you're guaranteed never to have a dull time!
This one has bitten me hard. After doing an update to the base system, I started to get messages from the link step of my program's compilation. Every symbol in the Wt library was "undefined". A hint to what was happening was the presence of the text "abi:cxx11" on every undefined symbol. The reasons why this has happened are pretty involved and are discussed here [[[http://allanmcrae.com/2015/06/the-case-of-gcc-5-1-and-the-two-c-abis/]]] and [[[https://developerblog.redhat.com/2015/02/05/gcc5-and-the-c11-abi/]]].
If you add the following to your compilation step, you side-step the problem.
-D_GLIBCXX_USE_CXX11_ABI=0
Good Luck!
Replies (4)
RE: Using C++ 5.3 - undefined symbols - Added by Wim Dumon over 9 years ago
I hated reading this :)
Wim.
RE: Using C++ 5.3 - undefined symbols - Added by Nicole King over 9 years ago
Wim,
I think it's worse than I have said. I've found some more issues with unresolved symbols in boost. I'm currently recompiling the whole library to see if it helps.
RE: Using C++ 5.3 - undefined symbols - Added by Wim Dumon over 9 years ago
I actually kind of expected that, it sounds like all of your system libraries + Wt will have to be carefully tuned to match this setting, or trouble will arise.
Actually this is already the case with earlier versions of gcc too: there is no binary compatibility for C libraries compiled with/without C+11 support. Boost is a fine example for this, so boost and Wt both have to be compiled with the same flags. I hoped gcc would move to an 'always enable c+11' by default, but apparently they chose for extra configuration flags that only make the situation more complex. Unfortunately...
At least with the new flags I hope trouble will always arise at compile time, while in the past the trouble came at unexpected moments during run-time (random crashes).
Wim.
RE: Using C++ 5.3 - undefined symbols - Added by Nicole King over 9 years ago
I totally agree. I finally eliminated all these issues by not using the D I described earlier, by first compiling boost, then Wt and finally my application. Oooh I foresee fun deploying this to PCs with an older libc installed.