Unable to link & call 32-bit Windows APIs using GAS Mode
d0mnik opened this issue · comments
attempting to compile
.data
msg: .string "Hello"
.text
.global _main
.intel_syntax noprefix
.extern MessageBoxA
_main:
# write your code here
push offset msg
push 0
call MessageBoxA
retreturns the following error undefined reference to MessageBoxA, despite the following flags in COLLECT_GCC_OPTIONS:
-lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt c:/program files (x86)/sasm/mingw/bin/../lib/gcc/mingw32/4.6.2/crtend.o
According to the Windows ABI _MessageBoxA@16 should be used instead.