/usr/bin/ld: i386:x86-64 architecture of input file `command.o' is incompatible with i386 output


/usr/bin/ld: i386:x86-64 architecture of input file `command.o' is incompatible with i386 output

出現這種警告的時候的時候,運行程序老是段錯誤,要加-m32,就好了。

gcc -m32 -o usehello_static usehello.c libhello.a

原因引用的庫是 32位的,我是用的64位的系統

參考:https://github.com/Liutos/LiutCL/issues/6 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM