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

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

问题描述:

当我尝试在同一计算机上编译,链接和运行的程序时,怎么可能出现GLIBCXX版本错误?有人知道吗?

How is it possible that a program that I compile, link and run on the same machine to have GLIBCXX version errors when I try to run it? Does anyone know?

这是我遇到的错误:

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

full output (with VERBOSE=1) including building and running is here: https://travis-ci.org/broadinstitute/gamgee/jobs/39751787

直到我切换到cmake之后才发生。同样的代码也可以在Clang上正常运行(使用libstdc ++的捆绑版本,因为我没有在VM上安装libc ++)。该日志在这里: https://travis-ci.org/broadinstitute/gamgee/jobs/ 39751786

This wasn't happening before, only after I switched to cmake. Also the same code runs fine with Clang (using a bundled version of libstdc++ since I haven't installed libc++ on the VM). That log is here: https://travis-ci.org/broadinstitute/gamgee/jobs/39751786

非常困惑。

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

Runtime paths are different to compile paths. Sounds like you have more than one version of your libraries on your system. check your LD_LIBRARY_PATH env variable and call your executable with ldd to see what libraries it is using/trying to use.