Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29251 Discussions

LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup

Brian_A_
Novice
1,158 Views
When compiling my code from a command prompt using a make file, this is the error that I am encountering:
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
Here is the results of my make.
Microsoft Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
if not exist o mkdir o
dir envrl\\*.hh /b /l /o >envrl\\filedoth
dir envrl\\*.ff /b /l /o >envrl\\filedotf
dir matpro\\*.hh /b /l /o >matpro\\filedoth
dir matpro\\*.ff /b /l /o >matpro\\filedotf
dir relap\\*.hh /b /l /o >relap\\filedoth
dir relap\\*.ff /b /l /o >relap\\filedotf
dir scdap\\*.hh /b /l /o >scdap\\filedoth
dir scdap\\*.ff /b /l /o >scdap\\filedotf
dir contmn\\*.ff /b /l /o >contmn\\filedotf
auxx\\builderm makerip
cd graphics
nmake -nologo -f graphicsi.mak NM=o FFLAGS= FPSTOP= O=o
'..\\lib\\graphics.lib' is up-to-date
cd ..\\steam
nmake -nologo -f steami.mak
'..\\lib\\steam.lib' is up-to-date
cd ..
nmake -nologo -f makrelap def=definei dfsc=dfsci NM=o FFLAGS= FPSTOP= O=o cpl= exedll=exe
envrl\\stgh2oo.exe envrl\\stgh2oo.pr
envrl\\stgh2oo.exe envrl\\stgh2oso.pr
envrl\\stgd2oo.exe envrl\\stgd2oo.pr
envrl\\sth2opugo.exe >envrl\\sth2opugo.pr
ifort -nologo -auto -Qansi_alias- -pad_source -warn -traceback -fltconsistency -fpconstant -nogen-interfaces -libs:qwin -thread -dbglibs lib\\relapo.lib lib\\scdapo.lib lib\\contmno.lib lib\\matproo.lib lib\\envrlo.lib lib\\graphics.lib lib\\filechck.lib graphics\\opengl32.lib graphics\\glu32.lib graphics\\f90gl.lib graphics\\f90glu.lib graphics\\f90glut.lib graphics\\glut32.lib -exe:bin\\relap5.exe -link
LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
bin\\relap5.exe : fatal error LNK1120: 1 unresolved externals
Copy lib\\glut32.dll bin
The system cannot find the file specified.
Copy lib\\libifcoremd.dll bin
1 file(s) copied.
Copy lib\\mscoree.dll bin
1 file(s) copied.
Copy lib\\msvbvm50.dll bin
1 file(s) copied.

Microsoft Program Maintenance Utility Version 9.00.21022.08Copyright (C) Microsoft Corporation. All rights reserved.
if not exist o mkdir o dir envrl\\*.hh /b /l /o >envrl\\filedoth dir envrl\\*.ff /b /l /o >envrl\\filedotf dir matpro\\*.hh /b /l /o >matpro\\filedoth dir matpro\\*.ff /b /l /o >matpro\\filedotf dir relap\\*.hh /b /l /o >relap\\filedoth dir relap\\*.ff /b /l /o >relap\\filedotf dir scdap\\*.hh /b /l /o >scdap\\filedoth dir scdap\\*.ff /b /l /o >scdap\\filedotf dir contmn\\*.ff /b /l /o >contmn\\filedotf auxx\\builderm makerip cd graphics nmake -nologo -f graphicsi.mak NM=o FFLAGS= FPSTOP= O=o'..\\lib\\graphics.lib' is up-to-date cd ..\\steam nmake -nologo -f steami.mak'..\\lib\\steam.lib' is up-to-date cd .. nmake -nologo -f makrelap def=definei dfsc=dfsci NM=o FFLAGS= FPSTOP= O=o cpl= exedll=exe envrl\\stgh2oo.exe envrl\\stgh2oo.pr envrl\\stgh2oo.exe envrl\\stgh2oso.pr envrl\\stgd2oo.exe envrl\\stgd2oo.pr envrl\\sth2opugo.exe >envrl\\sth2opugo.pr ifort -nologo -auto -Qansi_alias- -pad_source -warn -traceback -fltconsistency -fpconstant -nogen-interfaces -libs:qwin -thread -dbglibs lib\\relapo.lib lib\\scdapo.lib lib\\contmno.lib lib\\matproo.lib lib\\envrlo.lib lib\\graphics.lib lib\\filechck.lib graphics\\opengl32.lib graphics\\glu32.lib graphics\\f90gl.lib graphics\\f90glu.lib graphics\\f90glut.lib graphics\\glut32.lib -exe:bin\\relap5.exe -linkLINK : warning LNK4001: no object files specified; libraries usedLINK : warning LNK4068: /MACHINE not specified; defaulting to X86LINK : error LNK2001: unresolved external symbol _WinMainCRTStartupbin\\relap5.exe : fatal error LNK1120: 1 unresolved externals Copy lib\\glut32.dll binThe system cannot find the file specified. Copy lib\\libifcoremd.dll bin 1 file(s) copied. Copy lib\\mscoree.dll bin 1 file(s) copied. Copy lib\\msvbvm50.dll bin 1 file(s) copied.
0 Kudos
1 Reply
mecej4
Honored Contributor III
1,158 Views
It would be more inviting to look through the transcript if you used the "syntax highlighter" tool instead of pasting dozens of lines with the line breaks removed.

You probably have errors in the makefile. This line sums it up:

[bash]ifort -nologo   -auto -Qansi_alias- -pad_source -warn -traceback -fltconsistency  -fpconstant -nogen-interfaces -libs:qwin  -thread -dbglibs librelapo.lib  libscdapo.lib libcontmno.lib libmatproo.lib  libenvrlo.lib libgraphics.lib libfilechck.lib  graphicsopengl32.lib graphicsglu32.lib graphicsf90gl.lib  graphicsf90glu.lib graphicsf90glut.lib graphicsglut32.lib  -exe:binrelap5.exe -link

LINK : warning LNK4001: no object files specified; libraries used[/bash]
No object files were included in the link command issued through the driver ifort.
0 Kudos
Reply