I am having a problem with a new ABI introduced for C ++ 11 in GCC. After upgrading to GCC 5.3, my project no longer compiles. The error messages I get are simple:
undefined reference to `tokenize(std::__cxx11::basic_string' ...more characters
or
undefined reference to `extract(std::string const&)'
So it looks like I messed up something and GCC cannot decide if I want an old ABI or a new one (the __cxx11:: part is missing from some error messages and present in others)?
I tried several solutions to solve the problem:
- passing
-D_GLIBCXX_USE_CXX11_ABI=0 to GCC, - passing
-D_GLIBCXX_USE_CXX11_ABI=1 to GCC, - macro setup directly in the source code,
- setting the
abi_tag attribute in ads that GCC complained about when passing the -Wabi-tag flag,
Unfortunately, none of them worked (i.e., it allowed compiling the code). The only thing I know is that only functions that return std::string or accept it as a parameter cannot communicate. Which is to be expected, given what I read about the problem on the Internet. I could not reproduce the problem in a simple sample program to present it here.
Is there an obvious solution to my problem that I am missing?
source share