运行在同一台机器上编译的程序时,错误的GLIBCXX版本

时间:2014-11-02 15:08:57

标签: c++ cmake libstdc++

当我尝试运行它时,我在同一台机器上编译,链接和运行的程序如何才能产生GLIBCXX版本错误?有谁知道吗?

以下是我遇到的错误:

0.01s$ build/test/gamgee_test
build/test/gamgee_test: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by build/test/gamgee_test)
build/test/gamgee_test: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by build/test/gamgee_test)

完整输出(VERBOSE = 1)包括构建和运行在这里: https://travis-ci.org/broadinstitute/gamgee/jobs/39751787

之前没有发生这种情况,只是在我切换到cmake之后。同样的代码与Clang运行良好(使用捆绑版本的libstdc ++,因为我没有在VM上安装libc ++)。该日志位于:https://travis-ci.org/broadinstitute/gamgee/jobs/39751786

很困惑。

1 个答案:

答案 0 :(得分:1)

运行时路径与编译路径不同。听起来你的系统上有多个版本的库。检查你的LD_LIBRARY_PATH env变量并使用ldd调用你的可执行文件,看看它正在使用/试图使用哪些库。