【问题标题】:RHEL7 - /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not foundRHEL7 - /usr/lib64/libstdc++.so.6:未找到版本“CXXABI_1.3.8”
【发布时间】:2017-09-12 09:20:53
【问题描述】:

我知道这个问题已经被问过很多次了,但我仍然被它困住了。 我已经查看了之前提出的所有答案,例如 version `CXXABI_1.3.8' not found (required by ...)

How to fix: [program name] /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version CXXABI_1.3.8' not found (required by [program name])

我读过https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths

我的系统是RHEL7,之前安装了gcc 4.8,我用yum -y install devtoolset-3-gcc devtoolset-3-gcc-c++安装gcc 4.9

那么gcc 4.9就安装成功了。 使用gcc -v,我得到了

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-3/root/usr --mandir=/opt/rh/devtoolset-3/root/usr/share/man --infodir=/opt/rh/devtoolset-3/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC) 

然后我按照其他人的建议设置我的LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/opt/rh/devtoolset-3/root/usr/lib/gcc/x86_64-redhat-linux/4.9.2:${LD_LIBRARY_PATH}

但是,错误仍然存​​在,看来我的新版本 gcc4.9 不起作用。 任何帮助,将不胜感激!

【问题讨论】:

    标签: linux gcc rhel


    【解决方案1】:

    出现问题是因为devtoolset-x 包实际上只是包装了标准系统libstdc++.so,所以即使你有一个新的编译器,你仍然有旧的ABI(应用程序二进制接口)。所以你真正需要的是一个全新的编译器!其中将包括一个自己的新库。

    要构建编译器,您需要安装一些依赖项:

    sudo yum install gmp-devel mpfr-devel libmpc-devel
    

    您可以下载更新版本的 GCC from one of the official mirrors,获取诸如 gcc-8.3.0.tar.gz 之类的版本,将其解压缩并在该目录中

    ./configure --disable-multilib --enable-languages=c,c++ --prefix=$HOME/local
    make -j5
    make -j install
    

    那么当您需要现代 ABI 时,

    export LD_LIBRARY_PATH=$HOME/local/lib64
    

    一切都可以开始工作了。如果您的应用程序生成自己的环境(例如 Steam),您可能希望将库放置在它已经搜索的路径中。

    “重复”的答案要么是错误的,要么是过时的;这是今天的正确解决方案。我知道,因为我都试过了,这才是真正有效的方法......

    【讨论】:

    • 我猜有人想避免手动编译并找到一个发行包,但不幸的是,这似乎是 rhel7 的正确解决方案!
    • 做了 yum install 的事情,但仍然说找不到依赖项。从我提取到工作的路径运行./contrib/download_prerequisites
    猜你喜欢
    • 2017-12-07
    • 2015-10-10
    • 1970-01-01
    • 2020-02-13
    • 1970-01-01
    • 2015-06-05
    • 1970-01-01
    • 2011-07-10
    • 2017-12-27
    相关资源
    最近更新 更多