我有一个安装了 CMake、devtoolset-6 和标准 gcc 4.8.2 的项目。CMake 正确找到正确的 gcc:
-- The C compiler identification is GNU 6.2.1
-- The CXX compiler identification is GNU 6.2.1
-- Check for working C compiler: /opt/rh/devtoolset-6/root/usr/bin/cc
-- Check for working C compiler: /opt/rh/devtoolset-6/root/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/rh/devtoolset-6/root/usr/bin/c++
-- Check for working CXX compiler: /opt/rh/devtoolset-6/root/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
PATH 和 LD_LIBRARY_PATH 已设置
echo $PATH
/opt/rh/devtoolset-6/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
echo $LD_LIBRARY_PATH
/opt/rh/devtoolset-6/root/usr/lib64:/opt/rh/devtoolset-6/root/usr/lib
该项目正确构建,但与 /usr/lib64 中的错误 libgcc 和 libstd++ 冲突
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f60b47bf000)
libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007f60b45a8000)
怎么了?