Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gcc libstdc&x2B+;。因此,缺少GLIBCXX_3.4.15和GLIBCXX_3.4.20_Gcc_Libstdc++ - Fatal编程技术网

Gcc libstdc&x2B+;。因此,缺少GLIBCXX_3.4.15和GLIBCXX_3.4.20

Gcc libstdc&x2B+;。因此,缺少GLIBCXX_3.4.15和GLIBCXX_3.4.20,gcc,libstdc++,Gcc,Libstdc++,我已经安装了两个Linux。第一个是Ubuntu虚拟机,我的项目可以在它上顺利编译。(这个虚拟机是由某个以前的同事建立的。我稍后再讨论这个问题。)第二个是一个远程CentOS安装,我正在安装它来构建同一个项目 在CentOS安装上构建项目时,我在链接时遇到以下错误 ../boost/stage/lib/libboost_regex.so: undefined reference to `std::invalid_argument::~invalid_argument()@GLIBCXX_3.4.

我已经安装了两个Linux。第一个是Ubuntu虚拟机,我的项目可以在它上顺利编译。(这个虚拟机是由某个以前的同事建立的。我稍后再讨论这个问题。)第二个是一个远程CentOS安装,我正在安装它来构建同一个项目

在CentOS安装上构建项目时,我在链接时遇到以下错误

../boost/stage/lib/libboost_regex.so: undefined reference to `std::invalid_argument::~invalid_argument()@GLIBCXX_3.4.15'
../boost/stage/lib/libboost_filesystem.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
../boost/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
../boost/stage/lib/libboost_regex.so: undefined reference to `std::overflow_error::~overflow_error()@GLIBCXX_3.4.15'
../boost/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15'
../boost/stage/lib/libboost_regex.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
当我运行命令
strings/usr/lib64/libstdc++.so.6 | grep GLIBCXX
时,我发现
GLIBCXX_3.4.15
GLIBCXX_3.4.20
确实丢失了。(顺便问一下,GLIBCXX是什么意思?是ABI吗?)

顺便说一句,我在CentOS机器上构建了GCC4.9.2(以匹配Ubuntu机器)。以下是
gcc-v
输出:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++
Thread model: posix
gcc version 4.9.2 (GCC)
因此,显然我需要以不同的方式构建gcc,以便拥有
GLIBCXX_3.4.15
GLIBCXX_3.4.20
。我该怎么做呢


Ubuntu虚拟机规范 (用于比较。请注意,两者均为通用条款4.9.2)

GCC版本

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.2-10ubuntu13' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13) 

回答得很晚,但Ubuntu的GCC版本与您的GCC版本不同。请注意版本“4.9.2-10ubuntu13”。Ubuntu修补了它


我建议使用更新的编译器,可能是5.x或6.x.

很晚才回答,但Ubuntu的GCC版本与您的GCC版本不同。请注意版本“4.9.2-10ubuntu13”。Ubuntu修补了它

我建议使用更新的编译器,可能是5.x或6.x

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_DEBUG_MESSAGE_LENGTH
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.2-10ubuntu13' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)