首先要打开64位系统对32位的支持

第一步:确认64为架构的内核

dpkg --print-architecture

输出:
adm64

说明已拥有64位架构内核。

第二步:确认打开了多架构支持功能

dpkg --print-foreign-architectures

输出:
i386

说明已打开,如果没有需要手动打开

打开多架构支持

sudo dpkg --add-architecture i386
sudo apt -get update
sudo apt-get dist-upgrade

如此这般你就拥有了64位系统对32位的支持

其次是安装gcc multilab,可能需要apt-get update

 apt-get install gcc-multilib g++-multilib  

添加编译flag

CFLAGS  := -m32

Ubuntu 64编译32位程序的更多相关文章

  1. 在64位Ubuntu上编译32位程序常见错误

    问       题1: 找不到头文件 asm/errno.h 解决办法 : [/usr/lib/gcc$ ]sudo ln -s x86_64-linux-gnu/asm asm 问题2:找不到gcc ...

  2. 64位ubuntu编译32位程序

      最近在64位ubuntu上开发,需要编译32位程序,需要安装这两个包,然后在编译器参数加上-m32.不放心的话可以用ldd或file查看一下是否生成了对应位数的程序. $ apt-get inst ...

  3. 在64位linux下编译32位程序

    在64位linux下编译32位程序 http://blog.csdn.net/xsckernel/article/details/38045783

  4. VS2013下的64位与32位程序配置

    VS2013下的64位与32位程序配置   在Windows 7 64bit和Visual Studio 2013下生成64位程序. 新建一个Visual Studio Win32 Console项目 ...

  5. centos64位编译32位程序

    test.c #include <stdio.h> int main() { printf("sizeof long is %d\n",sizeof(long)); ; ...

  6. 64位linux编译32位程序

    昨天接到的任务,编译64位和32位两个版本的.so动态库给其他部门,我的ubuntu虚拟机是64位的,编译32位时遇到了问题: /usr/bin/ld: cannot find -lstdc++ 最后 ...

  7. ubuntu 64上的GCC如何编译32位程序

    运行命令 gcc -v 显示: Target: x86_64-linux-gnu 所以,我这里的gcc默认生成64位的程序. 如果想编出32位的程序,就要加 -m32选项.可是我尝试了,还是不行. 原 ...

  8. 在64位linux上编译32位程序 for i386 intel

    编辑中 # ld -V GNU ld version 2.15.92.0.2 20040927 Supported emulations: elf_x86_64 elf_i386 i386linux ...

  9. centos7 64运行32位程序

    yum在线安装: sudo yum install xulrunner.i686 或者: sudo yum install ia32-libs.i686 PS:可以查看一下当前源库里有没有ia32-l ...

随机推荐

  1. MSChart使用小结

        在用到图表展示某项.多项信息的统计情况,很正常联想到MSChart控件.        以VS2008开发为例,在工具箱也中右击,选择”choose items“,打开对话框,选择COM组件T ...

  2. It's a Buck; It's a Boost, No! It's a Switcher!

    It's a Buck; It's a Boost, No! It's a Switcher! Sanjaya Maniktala, National Semiconductor Corp., San ...

  3. Switch debouncer uses only one gate

    The circuit in Figure 1 produces a single debounced pulse each time you press S1. Moreover, the circ ...

  4. Spring 如何读取properties文件内容

    http://hi.baidu.com/alizv/blog/item/d8cb2af4094662dbf3d38539.html 在现实工作中,我们常常需要保存一些系统配置信息,大家一般都会选择配置 ...

  5. UltraEdit字体设置(fontlink大法)

    在网上游荡很久,查阅诸多资料,终于为UltraEdit选定了一套我喜欢的字体方案.这套字体方案是:英文字体使用Consolas,中文字体使用微软雅黑. 虽然说起来好像很清楚,但是因为在UltraEdi ...

  6. [Big Data] Week 5 A (Advance)

    Question 1 Consider the diagonal matrix M = 1 0 0 0 2 0 0 0 0 . Compute its Moore-Penrose pseudoinve ...

  7. Android 中的长度单位具体解释

    一.介绍一下 dp 和 sp. dp 也就是 dip.这个和 sp 基本类似.假设设置表示长度.高度等属性时能够使用 dp 或 sp.但假设设置字体,须要使用 sp. dp 是与密度无关,sp除了与密 ...

  8. struts2学习笔记(三)—— 在用户注冊程序中使用验证框架

    实现目标:       1.使用验证框架对用户注冊信息进行验证       2.验证username.password.邮箱不能为空       3.验证username.password长度     ...

  9. C#获取外网IP地址;C#获取所在IP城市地址

    public static string GetIP()         {             using (var webClient = new WebClient())           ...

  10. HDU1004——Let the Balloon Rise

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...