相关疑难解决方法(0)

devtoolset-6 正在使用系统 libstdc++ 并且无法链接

我有一个用 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)
Run Code Online (Sandbox Code Playgroud)

但是,我收到了很多与此类似的链接错误:

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

这似乎是因为 devtoolset 没有附带使用新编译器编译的 libstd++ 版本,因此链接器在 /usr/lib64 中找到了使用 gcc4 编译的标准版本,因此与编译的 …

g++ software-collections

7
推荐指数
1
解决办法
3169
查看次数

如何在 Fedora 上安装旧版本的 gcc

我尝试在 Fedora 31 上安装 CUDA 但在最后一步卡住了,因为 CUDA 官方支持 Fedora 29 (gcc 8.2) 而 Fedora 31 附带的版本是 9.2,然后我安装了支持 CUDA 的 Pytorch,不出所料,CUDA 支持是不存在:

>>> import torch
>>> device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
>>> device
device(type='cpu')
Run Code Online (Sandbox Code Playgroud)

然后我尝试在pkgs上搜索 gcc、g++ 和 gfortran ,但陷入了依赖地狱,例如:

sudo dnf install gcc-8.2.1-2.fc29.x86_64.rpm gcc-gfortran-8.2.1-2.fc29.x86_64.rpm gcc-c++-8.2.1-2.fc29.x86_64.rpm -y

Error: 
 Problem 1: conflicting requests
  - nothing provides cpp = 8.2.1-2.fc29 needed by gcc-8.2.1-2.fc29.x86_64
  - nothing provides libgomp = 8.2.1-2.fc29 needed by gcc-8.2.1-2.fc29.x86_64
 Problem 2: conflicting requests
  - nothing provides libgfortran …
Run Code Online (Sandbox Code Playgroud)

linux gcc python-3.x pytorch

7
推荐指数
1
解决办法
4125
查看次数

如何在 Centos 7 上安装较新版本的 libstdc++

我正在运行一个应用程序,它向我抛出一个错误:

“需要 C++ 标头‘string_view’。您需要在主机系统上安装更新的 libstdc++。”

有人可以指导我如何在我的计算机上获取更新版本的“libstdc++”吗?

谢谢

c++ centos libstdc++ centos7

7
推荐指数
1
解决办法
2万
查看次数

gcc 版本 9.3.0 时出现“g++:错误:无法识别的命令行选项 '-std=gnu++14'”

CentOS Linux release 7.9.2009 (Core)在 VirtualBox 中运行,它是由 构建Vagrant 2.2.19Ansible 2.9.25安装了所有依赖项。机器上安装了:

\n
gcc 9.3.0\npython 3.6.8\nnode.js 16.13.1\nnpm 8.1.2\n
Run Code Online (Sandbox Code Playgroud)\n

当 ansible 执行时,npm install我会出错g++: error: unrecognized command line option \xe2\x80\x98-std=gnu++14\xe2\x80\x99。我在 Stackoverflow 上看到了很多问题,答案告诉我将 gcc 升级到版本 >= 4.9。但我已经有了,但仍然收到错误。

\n

但是,有一个解决方法,它允许我运行npm install

\n
gcc 9.3.0\npython 3.6.8\nnode.js 16.13.1\nnpm 8.1.2\n
Run Code Online (Sandbox Code Playgroud)\n

但在我通过vagrant ssh. 我对此解决方法不满意,因为它是手动的并且必须npm istall以编程方式运行,因此它不能解决我的问题。

\n

我尝试从 ansible执行npm install内部:sclplaybook.yml

\n
sudo yum install -y centos-release-scl\nsudo yum install -y …
Run Code Online (Sandbox Code Playgroud)

gcc node.js centos7

3
推荐指数
1
解决办法
1万
查看次数

如何在 RHEL 7.4 上安装 C++14

我的问题类似于如何在 RHEL 7.4 上安装 gcc 4.9.2

但是我正在尝试在 Red Hat 7 上获得 C++14 支持,以便我可以安装 mapnik。

我试过了: # yum-config-manager --enable rhel-server-rhscl-7-rpms

安装 gcc,g++ 4.9.2 版: # yum install devtoolset-3-gcc-c++

启用 gcc-4.9, g++-4.9 : $ scl enable devtoolset-3 bash

但我不断得到

C++ 编译器不支持 C++14 标准(-std=c++14),这是必需的。请升级您的编译器

c++ c++14 rhel7

-1
推荐指数
1
解决办法
1万
查看次数