64位 linux操作系统下如何编译和运行32位源码
来源:互联网 发布:阿里巴巴怎么上传淘宝 编辑:程序博客网 时间:2024/06/06 17:26
1. 安装需要的库
X86_64 的 Redhat / Centos / Scientific 下面,若要编译、运行32位程序,需要安装以下包:
yum install glibc-static.i686
yum install glibc-devel.i686
2. 编译器需要添加选项
gcc -m32 -c qljt.c
qljt.c 就会以32bit 的模式编译了,。
3. 链接的时候有时候会提示没有 -lstdc++
原因: 其实就是 stdc++ 的版本不对;
解决办法:
1、执行命令: yum whatprovides libstdc++.so.6
然后会提示哪个安装包有这个库文件如下:
[root@localhost ~]# yum whatprovides libstdc++.so.6
Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, refresh-packagekit, security, tmprepo, verify,
: versionlock
Loading support for CentOS kernel ABI
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* centosplus: centos.ustc.edu.cn
* contrib: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
libstdc++-4.4.7-3.el6.i686 : GNU Standard C++ Library
Repo : base
Matched from:
Other : libstdc++.so.6[root@localhost app]# yum whatprovides libstdc++.so.6
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.opencas.cn
* extras: mirrors.pubyun.com
* updates: mirrors.skyshe.cn
libstdc++-4.8.5-4.el7.i686 : GNU Standard C++ Library
Repo : base
Matched from:
Provides : libstdc++.so.6
2、然后执行:
[root@localhost app]# yum install libstdc++-4.8.5-4.el7.i686
- 64位 linux操作系统下如何编译和运行32位源码
- 64位?32位?32位程序如何在64位linux下运行?
- Windows 32位程序在64位操作系统下运行
- 32位linux操作系统上编译 64位应用程序
- 如何在64位操作系统上使用masm进行编译链接和运行
- SuperMap Objects项目如何在64位操作系统下运行
- 在linux操作系统下如何查看内核是32位还是64位的
- 如何查看linux操作系统是32位还是64位
- 32位操作系统和64位操作系统
- Linux(ubuntu 64位)编译32位C源码
- 64 位 Arch Linux 系统上运行和编译 32 位程序。
- 32位软件如何在64位ubuntu下运行
- linux 源码arch目录下的处理器介绍与处理器架构总结 与 32/64位操作系统和CPU
- 64位操作系统下运行debug
- 如何在linux 32位机器编译64位程序
- 如何在64位linux强制编译32位应用程序
- 如何让eclipse 32位和64位同时运行
- 在64位linux下编译出32位程序
- android PhoneGap跨平台笔记1--helloword
- 安卓框架汇总
- 第三周项目1 个人所得税计算器
- Activiti 基础总结一
- java 时间戳和PHP时间戳的转换
- 64位 linux操作系统下如何编译和运行32位源码
- IOS崩溃 异常处理
- [.Net码农]DragDrop 注册失败的问题
- Android模拟器上网
- leetcode 82. Remove Duplicates from Sorted List II (线性表)
- sublime text3 常用快捷键
- nginx + tomcat 负载均衡
- 浙江省人口与计划生育条例
- UFLDL Tutorial系列关于Autoencoder的理解