LNK 2001 unresolved external symbol _mainCRTStartup MASM

Robert Joseph Dacunto picture Robert Joseph Dacunto · Sep 12, 2012 · Viewed 15.1k times · Source

I'm learning Assembly at my university, and we were given a CD with MASM 615 on it, and we're using the Irvine32 include library. Everything works fine with it on the school computer, but when I try to compile and run the same code on my home computer, I get a link error.

INCLUDE Irvine32.inc

.code
main PROC

mov eax,10000h      ; EAX = 10000h
add eax,40000h      ; EAX = 50000h
sub eax,20000h      ; EAX = 30000h
call DumpRegs

exit
main ENDP
END main

This code works fine on the PC at school. At home, I go into DOS, set the path to the MASM folder, and do Make32 file.

This is the error I get:

LINK32 : error LNK2001: unresolved external symbol _mainCRTStartup
test.exe : fatal error LNK1120: 1 unresolved externals

The program compiles (I get the .lst, .obj, and .pdb files), but that's it. I'm thinking it's because I have a 64-bit operating system at home, but I have zero idea how to get this up and running in a 64-bit enviornment - the CD or the book has nothing on 64-bit systems. There's only a make16 or make32 .bat file. It's a real bummer because that means I can't do any work at home, unless there's a work around?

Answer

K.R. picture K.R. · Feb 27, 2016

The other answers were confusing to me so I'll add my solution. In the properties of the project go to

Configuration Properties >> Linker >> Advanced

In Advanced at the top should be Entry Point. Type in main.