-2

I just want to move and add a few values but this error popped up the exact error is: error LNK2001: unresolved external symbol _ExitProcess@4. fatal error LNK1120: 1 unresolved externals

.386
.model flat, stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
.code 
main PROC 
    mov eax, 5
    add eax, 6

    INVOKE ExitProcess,0
main ENDP
end main
  • 1
    You should show the complete set of error messages by adding them all to the question. It could be that you aren't linking `kernel32.lib` that has `ExitProcess`? The exact error messages would give us a much better idea. As well, what commands do you use to assemble and link or are you using an IDE like Visual Studio? – Michael Petch Sep 15 '22 at 02:13
  • The build commands and exact error message are missing from your [mcve]. – Peter Cordes Sep 15 '22 at 02:17
  • I updated the code please answer my question – Rediet Workneh Sep 15 '22 at 08:42
  • 2
    You haven't told us the commands you use to assemble/link the assembly file to an exe. But based on the error it is clearly because you aren't telling the linker to include kernel32.lib (That contains `ExitProcess`) a file that should be available in one of the directories of the MASM32 SD (You did tag this originally as [MASM32)](https://www.masm32.com/). – Michael Petch Sep 15 '22 at 08:50

1 Answers1

0

I think I found the answer it was because I didn't include kernel32.lib