0

I'm building something with conda-build and cmake. cmake is being invoked with:

cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_CXX_FLAGS="-O3 -fstack-protector -pthread -D_GLIBCXX_USE_CXX11_ABI=0 --std=gnu++17 -L$CONDA_PREFIX/lib/ -lpolyphemus"

This is giving me the following error during linking:

polarwriter.cpp:(.text+0xe2e): undefined reference to `Polyphemus::Log::Stream()'

$CONDA_PREFIX/lib contains libpolyphemus.a, and checking that with nm shows:

0000000000000860 T Polyphemus::Log::Stream[abi:cxx11]()

...which says to me that the reference it's complaining about is set in a file that's in its linker path and that it's been told to link, unless the abi:cxx11 bit is doing something to invalidate it.

So I have no idea what else to tell it to do, since it's complaining about a file that it should be able to find. Any help appreciated!

Ben Taylor
  • 483
  • 2
  • 13
  • 1
    Does `-D_GLIBCXX_USE_CXX11_ABI=0` tell the linker to *not* use the cxx11abi? – wcochran Dec 30 '21 at 18:48
  • 1
    It looks to me the libs were built with CXX11 ABI so you can't link against it w/o enabled it .. see https://stackoverflow.com/questions/45417707/glibcxx-use-cxx11-abi-gcc-4-8-and-abi-compatibility – wcochran Dec 30 '21 at 18:52
  • 1
    You mix libraries (object files) compiled with different ABI settings. – Igor R. Dec 30 '21 at 18:54
  • Yup, the ABI was the problem. That'll teach me to run with inherited files without paying attention to what they're actually doing. Thanks both, @wcochrane you were first, if you want to post that as an answer I'll accept it. – Ben Taylor Dec 30 '21 at 19:02

0 Answers0