簡體   English   中英

devtoolset-6 正在使用系統 libstdc++ 並且無法鏈接

[英]devtoolset-6 is using system libstdc++ and can't link

我有一個用 gcc6 編譯的第 3 方庫,我需要鏈接它。 所以我卸載了標准的 GCC 包並安裝了 Software Collections devtoolset-6 包(Centos 7.4)

$ g++ -v

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-6/root/usr --mandir=/opt/rh/devtoolset-6/root/usr/share/man --infodir=/opt/rh/devtoolset-6/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --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-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-6.3.1-20170216/obj-x86_64-redhat-linux/isl-install --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 6.3.1 20170216 (Red Hat 6.3.1-3) (GCC)

但是,我收到了很多與此類似的鏈接錯誤:

libcomsd.so: undefined reference to `operator delete[](void*, unsigned long)@CXXABI_1.3.9'

這似乎是因為 devtoolset 沒有附帶用新編譯器編譯的 libstd++ 版本,所以鏈接器在 /usr/lib64 中找到了標准版本,它是用 gcc4 編譯的,因此與編譯的 libcomsd 二進制不兼容使用 gcc6。

有沒有辦法讓所有這些工作? 一些用 gcc6 編譯的 libstd++ 包?

devtoolset-9 解決了缺少動態so library的問題。
絕對路徑是以下路徑:

/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++.so

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM