I've been building asm code using the following command line to much success.
nasm -f OBJ someFile.asm
The resulting .o file is linked using ALINK. The following command line is traditionally used.
alink -c -oPE -subsys gui someFile.o
The resulting .exe file works quite happilly. If you aren't familiar with alink, the ?-c? enables case sensitivity, the ?-oPE? enables Windows Portable Executable output style, and ?-subsys gui? causes a win32 executable to be produced.
All has been good so far. But lately i've been attempting to take ALINK out of the chain and use MS Visual Studio C++ 6.0 instead.
To keep VCPP happy, i have been using the following command line
nasm -f coff someFile.asm
which, for the most part, appears to work just fine. except for one thing. i can't get api functions to import correctly. the syntax i've been using is
EXTERN MessageBoxA
IMPORT MessageBoxA User32.dll
This compiles fine under -fOBJ, but causes an error under COFF. This is the error.
5: error: parser: instruction expected
I can take the import instruction out, and it compiles fine in nasm. But C++ reports "Unresolved external MessageBoxA"
I'm not sure if this is a decoration issue, or a syntax issue with nasm. Shouldn't I still use import under coff? Why doesn't the parser like it?