Why does the linker emit this unexpected error message for this very simple assembly code?

  • Thread starter Thread starter Belloc
  • Start date Start date
B

Belloc

Guest
.MODEL flat ; *** No language selected ***

ExitProcess PROTO STDCALL, dwExitCode: DWORD

.CODE
main PROC
invoke ExitProcess, 0
main ENDP

END

With linker option /SUBSYSTEM = Not set and /ENTRY = main, the code builds and executes without a problem. That is fine.

Now, if I change main in the code by _main and set the linker option /ENTRY = _main the linker produces the following error message:

LNK2001: unresolved external symbol __main

__main with 2 underscores!

How is that possible? There should be no name decoration in this case !!!

Continue reading...
 
Back
Top