/usr/bin/ld: warning: i386 architecture of input file `./src/main.o' is incompatible with i386:x86-64 output
出现这种警告的时候的时候,运行程序老是段错误,要加-ms32,就好了。
gcc -m32 -o usehello_static usehello.c libhello.a
原因引用的库是 32位的,我是用的64位的系统
本文详细解释了如何解决在使用gcc编译器时遇到的关于32位与64位架构不兼容的警告。通过示例代码演示了如何正确调用32位库以确保程序在64位操作系统上正常运行。
/usr/bin/ld: warning: i386 architecture of input file `./src/main.o' is incompatible with i386:x86-64 output
出现这种警告的时候的时候,运行程序老是段错误,要加-ms32,就好了。
gcc -m32 -o usehello_static usehello.c libhello.a
原因引用的库是 32位的,我是用的64位的系统
1397
9476
2768
2794
1369
2906

被折叠的 条评论
为什么被折叠?