I'm trying to print a format string in NASN 64 (linux-fedora) but I'm getting an error that says "cannot find -lc" and "ld returned 1 exit status".
; ----------------------------------------------------------------------------------------
; Testing extern printf to print a format string.
; Linux-Fedora/.
; To assemble and run:
;
; nasm -felf64 printf.asm
; gcc -static -o printf printf.o
; ----------------------------------------------------------------------------------------
;--------------------------------Varibles declaradas--------------------------------------
section .data
string db "The number is: %d", 10, 0
;-----------------------------------------------------------------------------------------
;-----------------------------------------------------------------------------------------
section .text
extern printf
global main
main:
mov rdi, string ;the format string
mov rsi, 10 ;the argument (number 10)
xor eax, eax ;no vector in use
call printf
;exit(0)
mov rax, 60
mov rdi, 0
syscall
To get to print the string.