对64位32位编译程序的Linux操作系统将导致致命错误 [英] Compile program for 32bit on 64bit Linux OS causes fatal error
本文介绍了对64位32位编译程序的Linux操作系统将导致致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用
gcc -m32 myprog.c
应32位版本的编译文件 myprog.c中
不幸的是我得到这个错误
unfortunately I get this error
In file included from /usr/include/stdio.h:27:0,
from myprog.c:1:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
# include <sys/cdefs.h>
我怎么能解决这个问题?
How could I fix this?
如果我不使用 -m32
工作,但使用64位istructions
If I don't use -m32
works but uses 64 bit istructions
推荐答案
要编译在64位Linux版本的32位二进制文件,您必须安装 libx32gcc
开发包和32位GNU C库
To compile 32 bit binaries on 64 bit Linux version, you have to Install libx32gcc
development package and 32 bit GNU C Library
试试这个
sudo apt-get install libx32gcc-4.8-dev
和
sudo apt-get install libc6-dev-i386
这篇关于对64位32位编译程序的Linux操作系统将导致致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文