C++ 升压链接错误未定义参考GLIBCXX_3.4

C++ 升压链接错误未定义参考GLIBCXX_3.4,c++,boost,cmake,C++,Boost,Cmake,我正在尝试使用ubuntu下的叮当声与boost链接。我得到以下错误: /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libboost_filesystem.a(operations.o): undefined reference to symbol '_ZNSs4_Rep10_M_destroyERKSaIcE@@GLIBCXX_3.4' /usr/lib/x86_64-linux-gnu/li

我正在尝试使用ubuntu下的叮当声与boost链接。我得到以下错误:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libboost_filesystem.a(operations.o): undefined reference to symbol '_ZNSs4_Rep10_M_destroyERKSaIcE@@GLIBCXX_3.4'
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我已经将find_包(Boost组件文件_system,system)添加到cmake中。知道是什么导致了这个错误吗?

这个错误是因为Boost是使用gcc标准库libstdc++构建的,而我是使用clang libc++编译的


之前我使用的是apt get下载的Boost。从boost.org下载源代码并使用clang及其标准库手动编译解决了这个问题。

我检查了cmake生成的build命令,链接在objects之后。当我从
g++
切换到
clang++
时,我收到了类似的消息,我不小心输入了
clang
(C-only/automatic compiler,这意味着它不喜欢正确地使用
libc++
)。