Why the different results for the two assemblies below?

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

Belloc

Guest
The code below builds without a problem with the following linker options: /ENTRY = main, /SUBSYSTEM = Not set in the project property page.

.386
.MODEL flat, stdcall
.stack 4096

ExitProcess PROTO STDCALL, dwExitCode: DWORD

.CODE
main PROC
mov eax, -1
invoke ExitProcess, 0
main ENDP

END

But when I try to build the similar code below, just replacing main by WinMain, and the linker options /ENTRY = WinMain and /SUBSYSTEM = Not set, the linker complains with the error "LNK1221: a subsystem can't be inferred and must be defined".

.386
.MODEL flat, stdcall
.stack 4096

ExitProcess PROTO STDCALL, dwExitCode: DWORD

.CODE
WinMain PROC
mov eax, -1
invoke ExitProcess, 0
WinMain ENDP

END

Continue reading...
 
Back
Top