所以,我写了一些关于asm的指令,并编译它们。在mac os上编译汇编程序在nasm上
nasm -f macho test.asm
现在,NASM生成OBJ文件,test.o
gcc test.o
返回下一个错误:
在一行gcc
- ld: warning: ignoring file test.o, file was built for unsupported file format which is not the architecture being linked (x86_64)
- Undefined symbols for architecture x86_64: "_main", referenced from:
- start in crt1.10.6.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status
,我使用-arch I386(x86_64的),返回相同错误。
任何人都可以帮忙吗? :)
难道你试试'-f macho64'而不是'macho'? – Matthias 2013-02-21 09:59:11