
3个回答
展开全部
在64位的Linux下,gcc 编译 32 位程序需要添加参数 -m32 ,ld需要添加参数是 -m elf_i386。
1、Along with the -m32 flag in gcc, you may need to include the -melf_i386 flag for ld to properly link the 32bit object files to the 32bit libraries if you have both the 32bit and 64bit libraries.
2、 ld命令 ld命令是GNU的连接器,将目标文件连接为可执行程序。
3、举例:
gcc -m32 -o hello hello.c
gcc -m32 -c hello.o hello.c
ld -m elf_i386 -o kernel main.o hello.o
1、Along with the -m32 flag in gcc, you may need to include the -melf_i386 flag for ld to properly link the 32bit object files to the 32bit libraries if you have both the 32bit and 64bit libraries.
2、 ld命令 ld命令是GNU的连接器,将目标文件连接为可执行程序。
3、举例:
gcc -m32 -o hello hello.c
gcc -m32 -c hello.o hello.c
ld -m elf_i386 -o kernel main.o hello.o
展开全部
这个比较麻烦。
首先你要装好全套的 32 位对应的开发编译支持环境和对应的运行环境,之后还要设置你这个软件编译时用 32 位的参数和 32 位的编译器。
你这个其实等同于交叉编译。
首先你要装好全套的 32 位对应的开发编译支持环境和对应的运行环境,之后还要设置你这个软件编译时用 32 位的参数和 32 位的编译器。
你这个其实等同于交叉编译。
更多追问追答
追问
使用gcc编译加上-m32就可以了。
追答
不全是
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
装openSUSE 下32位需要的开发包
追问
可否具体一些?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询