NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: mark allyn on August 08, 2009, 02:55:09 AM
-
Hello everyone -
I am trying to write a very simple NASM pgm that shows a windows messagebox. My NASM code assembles fine to an mbox.obj with Win32 format. Where i fail is in the link step. I have tried Alink as well as GCC to do the linking. With either I get a message saying that _MessageBoxA isan unresolved external. If I strike the underscore in front of MessageBox, I still get the same reply. I have defined MessageBoxA as an external in the code segment.
I apparently am missing some WinAPI's. Or something. Any ideas?
Thanks,
Mark Allyn
-
It could be that 'win32.lib' is old/buggy/incomplete. If you are really serious about experimenting with the win32 API functions without incurring additional headaches, I recommend one of these paths:
Go Tools:
http://www.jorgon.freeserve.co.uk/ (http://www.jorgon.freeserve.co.uk/)
HLA:
http://webster.cs.ucr.edu/AsmTools/HLA/index.html (http://webster.cs.ucr.edu/AsmTools/HLA/index.html)
RosAsm:
http://betov.free.fr/ (http://betov.free.fr/)
MASM32:
http://www.movsd.com/ (http://www.movsd.com/)
Nathan.
-
Hi Nathan -
Thanks for the advice. There are so many reasons to stick with NASM and MinGW that I really don't want to try yet another assembler. I already do some stuff with MASM and using it gives me good access to Win32 api's. But, MASM syntax is a bit difficult compared to NASM (I find) so I'd prefer to work off MinGW and NASM. MinGW gives me the gcc compilers and they are really nice for straight c/c++. All I want to do is be able to do in NASM what I can do in MASM.
Should be possible!!! would you mind if I sent you my little messagebox plus the command lines? Maybe I'm missing something simple...
Mark Allyn
-
Please do post the command line(s) you're using. I, at one time, had some success with "%define MessageBox _MessageBoxA@16" (four parameters to MessageBox, right? Make it "@20" if there are five). You could, of course, use "_MessageBoxA@16" throughout. Unless I'm mistaken, this is something those "includes" would take care of. More later...
Best,
Frank