I'm trying to link a simple assembly code using gcc but i get the compile error Undefined reference to "WinMain@16"
. I'm currently using Windows and NASM to compile.
Compile command using nasm defaults
nasm -fwin32 C:\Users\james\Desktop\hello.asm
link command gcc using defaults
gcc C:\Users\james\Desktop\hello.o -o hello.exe
installed using Mingw code:
extern _printf
global _main
section .data
msg: db "Hello, world!",10,0
section .text
_main:
push msg
call _printf
add esp,4
ret
using win os 10 Toshiba laptop.