Linking a program using printf with ld?
问题 I'm getting a undefined reference to _printf when building an assembly program that defines its own _start instead of main , using NASM on x86-64 Ubuntu Build commands: nasm -f elf64 hello.asm ld -s -o hello hello.o hello.o: In function `_start': hello.asm:(.text+0x1a): undefined reference to `_printf' MakeFile:4: recipe for target 'compile' failed make: *** [compile] Error 1 nasm source: extern _printf section .text global _start _start: mov rdi, format ; argument #1 mov rsi, message ;