试图在CentOS上编译32位应用程序导致错误
Attempting to compile a 32 bit application on CentOS results in error
所以我已经安装了devtools,但我猜我的libstdc++库的版本不正确,或者不是32位?我在尝试编译时遇到这个错误。我该如何解决这个问题?
/opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: skipping incompatible /opt/centos/devtoolset-1.1/root/usr/lib/gcc/x86_64-redhat-linux/4.7.2/libstdc++_nonshared.a when searching for -lstdc++_nonshared
/opt/centos/devtoolset-1.1/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/ld: cannot find -lstdc++_nonshared
我也有类似的问题,并且已经厌倦了devtoolset 1、1.1和2,所有这些都得到了相同的结果。进一步研究,我在目录中看到:
/opt/centos/devtoolset-1.0/root/usr/lib/gcc/x86_64-CentOS-linux/4.7.0
有一个"32"目录,在这里有一些库文件和指向另一个目录的链接,这些目录指示"i386":
libitm.a -> ../../../i386-CentOS-linux/4.7.0/libitm.a
libitm.so
libquadmath.a -> ../../../i386-CentOS-linux/4.7.0/libquadmath.a
libquadmath.so
libstdc++.a -> ../../../i386-CentOS-linux/4.7.0/libstdc++.a
libstdc++_nonshared.a -> ../../../i386-CentOS-linux/4.7.0/libstdc++_nonshared.a
libstdc++.so
libsupc++.a
此"i386"目录不是使用诸如之类的命令通过百胜安装的
yum install devtoolset-2
在x64 CentOS计算机上。
正如Zinglish上面所问的那样,如何使用yum将32位库安装在64位操作系统上?我正在使用http://people.centos.org/tru/devtools-2用于RPM源。
64位CentOS 6和devtoolset 1.1也存在类似问题。
32位库似乎安装在:中
/opt/centros/devtoolset-1.1/root/usr/lib/gcc/x86_64-redhat-linux/4.72/32
目录中的一些库与../../..中的文件符号链接/i686 redhat-linux/4.7.2/,它们不存在。
所以我明确安装了devtoolset 32位库:
百胜安装devtoolset-1.1.*i686
但不知何故,它们安装在/opt/rh/devtoolset-1.1/root/usr/lib/gcc/i686-redhat-linux/4.7.2/中,因此手动将目录符号链接到所需位置:
ln-s/opt/rh/devtoolset-1.1/root/usr/lib/gcc/i686-redhat-linux/opt/rh/devtoolset-1.1/root/usr/lib/gcc/.
并最终成功编译了32位应用程序。
我之前也遇到过类似的问题,我猜出了原因并找到了解决方案。
环境:
(centos6 x64 g++)
问题:当我试图用Makefile编译.cpp和.h时,我在下面遇到了一个错误
skipping incompatible .../libstdc++.so
原因:
> tried to compile 32bit at 64bit linux machine(centos). However there
> was no appropriate g++ library.
解决方案:安装libstdc++
yum list *stdc*
yum install libstdc++-devel.i686
- 示例外壳应用程序显示的 V8 "segmentation fault (core dumped)"错误
- C++应用程序 MySQL odbc 数据库连接错误:在引发"otl_tmpl_exception<>"实例后终止调用
- Visual Studio中的wxwidgets应用程序给出错误"LNK2019 unresolved external symbol"
- 调用 java 的回调() 时应用程序崩溃.由于 detatchThread 而获得运行时错误
- 设置我的应用程序 API 感知并防止系统使其模糊和错误定位
- 错误: 无效使用非静态数据成员"应用程序::应用程序构造函数"
- QT C++防止关闭应用程序时出现运行时错误
- JNI 在应用程序中检测到错误:在为 innerclass 调用 NewObject 时使用了无效的 jobject
- 如何使用CLion和MSVC编译器工具链编译wxWidgets Hello World应用程序而没有错误?
- 运行 libpng 应用程序时出现运行时错误
- .exe应用程序在windows10中创建新模块时抛出错误,但在windows7中工作正常
- 由于选项卡顺序的原因,鼠标光标总是得到错误的hwnd-MFC应用程序
- SDL 应用程序错误:“if”之前应为非限定 id
- Cygwin1.dll c++ 应用程序错误
- ilmerge后C /CLI应用程序错误
- OPENCV:image_proc中的 PCA 应用程序错误
- 可视C++窗体应用程序错误: C3374
- Windows 窗体应用程序错误
- 多线程应用程序错误C++
- 需要一个健壮的win32 GUI应用程序错误系统