0

我正在使用 nasm 汇编程序,然后与 ld 链接,直到今天我收到此错误时它一直有效

$ ld -macosx_version_min 10.8.0 -o objctest.o -lSystem
ld: warning: -arch not specified
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture x86_64

汇编代码

global  _main

align 4, db 0x90

section .text
_main:
push ebp
mov  ebp, esp
mov eax, 88
mov esp, ebp
pop ebp
ret
4

0 回答 0