OK, so we’re still using VC6.0. Â Gluttons for punishment, I guess.
I recently created a new MFC app and had some… opportunities getting it to compile, so I thought I’d document them here for the three other people in the world not on VC9.
First: when you start a new MFC app and switch the project-level #define of _MBCS to UNICODE,_UNICODE, then compilation suddenly breaks with the error “msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16″. Â Solution: add /entry:”wWinMainCRTStartup” to the linker command line in the text area under the Link tab. Â In newer versions of VC, there is an “Advanced” linker tab that allows you to do this through the dialog interface. Â Not present in VC6.
Second: when you add ATL to your MFC project (Insert | New ATL Object… ; click Yes on the dialog, then click cancel. Â Now you’re cooking with ATL even though you have no ATL objects.) Â Suddenly your debug builds don’t compile anymore. Â Problem: the project-level #define of _CRTDBG_MAP_ALLOC causes errors like this:
Compiling…
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\include\malloc.h(105) : error C2059: syntax error : 'constant' c:\program files\microsoft visual studio\vc98\include\malloc.h(105) : error C2733: second C linkage of overloaded function '_calloc_dbg' not allowed c:\program files\microsoft visual studio\vc98\include\malloc.h(105) : see declaration of '_calloc_dbg'
Post a Comment