Click to See Complete Forum and Search --> : LNK2001 + _wWinMainCRTStartup
Vaderman
August 6th, 2004, 05:06 AM
I've just ported my code from VC6 to VC 7 (AGAIN!!!!!) and I've set Use Managed Extensions to Yes.
The file is an exe app and its complaining with the folllowing :
LINK : error LNK2001: unresolved external symbol _wWinMainCRTStartup
..\Debug/MyExe.exe : fatal error LNK1120: 1 unresolved externals
I've looked on M$DN and yeah it has alot of info on the subject but nothing particularly useful!
I hate .Net migration!! never have I had sooooo many darn problems with such an easy task!!! well done M$! :mad:
Regards
John
f1shrman
August 11th, 2004, 07:38 PM
I seem to remember having issues with vc6 and the ATL wizard - I wonder if this is similiar.
from http://www.devguy.com/fp/Tips/COM/
"LIBCMT.lib (crt0.obj) : error LNK2001: unresolved external symbol _main
If you get this error when building the release build, simply click on the C/C++ tab in Project->Settings and select Preprocessor from the Category drop-down box. Remove the _ALT_MIN_CRT flag in the Preprocessor definitions box. By default, ATL release builds use a tiny version of the C runtime library (CRT). However, this tiny CRT does not include certain functions which your ATL project may use. Therefore, you will get unresolved symbols. By removing this flag, you will tell the linker to link in full-size version of the CRT. However, this only increases your DLL by ~30KB.
"
HTH
x1x1x
September 24th, 2005, 09:48 PM
hey I have exactly the same problem, whenever I wanna compile my MFC applications I get that error and when I wanna run my console applications I get a msg in that says "Cannot execute program". I am not getting my output files not even the DEBUG folder, and I am really going insane trying to figure out why that is happening.
If anybody knows why that is, please answer. Thanks.
1X1X1
mikanu
September 26th, 2005, 01:28 PM
I'm not sure if this is going to fix your problem but here's a couple things you could try.
First, make sure that you #define WIN32_LEAN_AND_MEAN in your stdafx.h header file, in case you're using precompiled headers (this is by default) or in you're main header file if not using precompiled headers. Then make sure you #include <windows.h> or #include <afxwin.h> but keep in mind that if you include afxwin.h you shouldn't be including windows.h
Second, if your project was a library then you could have tried adding "__DllMainCRTStartup@12" to the Force Symbol References, in the Input section of the Linker node in the project preference dialog (see the attached image).
Other than the above, I have no ideas... good luck!
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.