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



当我试图运行一个在同一台机器上编译、链接和运行的程序时,它怎么可能出现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

非常困惑。

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