2014-11-02 54 views
0

在我尝试运行时,我在同一台机器上编译,链接和运行的程序有可能出现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) 

全输出(带有详细= 1),包括建设和运行是在这里: https://travis-ci.org/broadinstitute/gamgee/jobs/39751787

这是以前没有发生的事情,只有经过我切换到cmake。同样的代码与Clang一起运行良好(使用捆绑版本的libstdC++,因为我没有在VM上安装libC++)。该日志在这里:https://travis-ci.org/broadinstitute/gamgee/jobs/39751786

非常困惑。

回答

1

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

+0

我该如何检查运行时并明确编译库路径?我认为'ld --verbose | grep SEARCH'告诉我编译和运行时的搜索路径。 – Carneiro 2014-11-02 15:27:32

+0

你说得对,从gcc 4.6安装了第二个libstdC++。经过多番调整,我可以通过从/ usr/lib64链接来替换4.9.1 stdlibC++。这是我可以欺骗travis的唯一方式(因为我无法将/ usr/lib64添加到ld.so.conf中)。 – Carneiro 2014-11-02 16:46:27

相关问题