Hello!
I am quite new to NASM, for some time I've used FASM (NASM syntax is a bit scary for beginners), but in general, I'm also quite new to ASM.
At the moment, I am mostly playing around with this assembler to learn its syntax fully. Much of it I like, and it's been pretty straight forward so far, although this morning I encountered a problem with WinAPI imports and I hope that you can help me..
So.. I'm declaring an extern using the obvious 'extern' directive:
extern Sleep
In my code I then call this a couple of times, this is not very important, it assembles nicely with:
nasm -f win32 -Ox -o code.obj code.s
However when I try to link with this line, using Microsoft LINK, all hell is let loose:
link /ENTRY:main /SUBSYSTEM:console /MACHINE:X86 kernel32.lib code.obj
code.obj : error LNK2001: unresolved external symbol Sleep
code.exe : fatal error LNK1120: 1 unresolved externals
I have tried declaring the symbol _Sleep, __imp__Sleep and __imp__Sleep@4 but it generates the same error.
What am I doing wrong here? Should I maybe just use another linker? Anyone else had these problems?
And another question: Whats the essential difference between a %define and an equ? Is there any differences but the one that equ supports various expressions? Hope I don't appear too nooby
Thanks!