我有一个应用程序需要在我的64位CentOS 7上编译为32位,为此我使用了-m32标志。我还需要c++17的功能,所以我想安装gcc 8.x。我发现devtoolset 8附带了gcc 8.2.1,这对我来说是件好事。
应用程序编译正常,但问题出在链接上-它找不到一些32位的库:
[100%] Linking CXX executable cherrySim_runner /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: cannot find /usr/lib/libstdc++.so.6 /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: skipping incompatible /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++_nonshared.a when searching for -lstdc++_nonshared /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: cannot find -lstdc++_nonshared /opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/ld: cannot find /lib/libgcc_s.so.1
我发现devtoolset准备了一些32位的库,但这些是指向不存在的路径的链接,例如:/opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/32/libstdc++_nonshared.a -> ../../../i686-redhat-linux/8/libstdc++_nonshared.a。根本没有/opt/rh/devtoolset-8/root/usr/lib/gcc/i686-redhat-linux目录。我尝试了几种方法,但似乎都不起作用。
我开始怀疑我正在尝试做的事情是不是可能。
Michał
发布于 2019-03-29 20:03:40
不幸的是,我发现在CentOS上没有包含32位版本的gcc标准库>8的软件包。
我需要这个作为我的docker镜像,但由于无法做到这一点,我切换到了ubuntu i386 16.04,它可以非常容易地安装gcc 8.2。
https://stackoverflow.com/questions/55278573
复制相似问题