0
我在組裝一個新手,和我有我有這個彙編代碼保存爲file.asm和使用終端編譯它無法建立在Linux中的可執行文件, :'ld'是什麼?
nasm -f elf file.asm
ld -o file file.o" // the problem lies here. I always get this notice:
ld: i386 architecture of input file 'file.o' is incompatible with i386:x86-64"
所以,我無法繼續運行該文件。這可能是因爲我的Ubuntu版本,但我認爲不是。 :(我不知道。幫助。
'-f elf'是簡寫'-f elf32'嘗試使用'-f elf64'代替或者,如果你真的想建立一個32位應用程序你。可以使用像這樣的鏈接:'gcc -m32 -o test test.o' – Michael
對,或者如果只是使用'ld','ld -o file file.o -melf_i386'。 –