When trying to link my program, I receive the following errors:

error lnk2001: unresolved external symbol __imp__ExitProcces@4
error lnk2001: unresolved external symbol DefaultExceptionHandler
error lnk2001: unresolved external symbol stdio_newln
error lnk2001: unresolved external symbol stdio.puts
error lnk2001: unresolved external symbol $HardwareException
error lnk2001: unresolved external symbol Raise

I'm a newbie and I am running masm32 on win2k.
Posted on 2001-09-18 12:09:02 by Unregistered
The message is saying there is some variable/function declared in your code whos declaration is in some other object or lib file.

You've declared it as a symbol otherwise the error would be:
"c:\temp\ab\a.asm(15) : error A2006: undefined symbol : ExitProcess"

or something similar (basically linker error A2006 rather than A2001).

The ExitProcess function resides in kernel32.dll so you'll need to include the lib for it (kernal32.lib usually)!

It is a little unusual though, as you've got an unexpected "__imp" infront of the call....

It would be helpful if you posted the code....

Mirno
Posted on 2001-09-19 03:52:24 by Mirno
kernel32.lib, not kernal32.lib. I wonder why I see so many people
writing "kernal" from time to time... it isn't in my dictionary :).

The __imp_ prefix is not very strange, it probably just means you're
calling the import directly, instead of the j_import. The weird stuff
are stdio_newln, stdio.puts, Raise, and $HardwareException.
Are you trying to assemble the output of some C++ compiler, or link
an asm project to some C/C++ code?
Posted on 2001-09-19 04:34:49 by f0dder
Hi,

I've got the same problem but with the SetLayeredWindowAttributes
API.
I have updated my user32.inc and add INCLUDELIB User32.lib
...so why do I have a "unresolved external symbol _SetLayeredWindowAttributes@16" error :confused:
Posted on 2001-09-19 05:03:47 by PhoBos
PhoBos, your library files are probably too old. And anyway, you should
use GetProcAddress to import "fancy" stuff like SetLayeredWindowAttributes,
and only use them if they are available.
Posted on 2001-09-19 05:10:07 by f0dder
f0dder,

My User32.lib file comes from VS6 sp5 and i can use the API function in VS. I thought MASM can find it if I add it in my INC file...
But I will try using GetProcAddress.

Tx a lot.
Posted on 2001-09-19 05:17:11 by PhoBos
The inc file is not enough, you need to update your lib files as well.
Just copy all the VCSP5 lib files over your masm lib files, it should work.
Posted on 2001-09-19 05:20:36 by f0dder
Already done ! :(
Got always the same error...
Trying GetProcAddress.....
Posted on 2001-09-19 05:26:33 by PhoBos
All right, using GetProcAdress it works !!!
Tx for your help f0dder ! :)
Posted on 2001-09-19 07:29:16 by PhoBos