Mac OS X and static boost libs -> std::string fail

后端 未结 1 932
温柔的废话
温柔的废话 2021-01-05 16:39

I\'m experiencing some very weird problems with static boost libraries (Boost 1.45.0-2 from MacPorts, compiled as fat/universal (x86/x86_64) libraries) under Mac OS X 10.6.6

相关标签:
1条回答
  • 2021-01-05 17:07

    The problem was that Boost has been built using Apple's GCC 4.2.1, whilst I've been building the project using a different compiler.

    As I tried to link the static Boost libraries, also the GCC 4.2.1 libstdc++ was put into the binary. However, at the same time the other GCC version was linking in its libstdc++ and name space problems were inherent, thus the wrong functions were called and the like.

    The most simple fix is re-building Boost with your target GCC version and retry the building of your program (ofc. using the self-built Boost.)

    Be warned: do not try to change the compiler MacPorts uses for building Boost (it's even not easily possible), or system breakage may occur. Instead, build Boost on your own.

    0 讨论(0)
提交回复
热议问题