描述:
在我的alt com 里面
Creating library ReleaseUMinSize/AdV1.lib and object ReleaseUMinSize/AdV1.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseUMinSize/AdV1.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
我把DEBUG版改成UNICODE MINI Release版就出这种问题。请问是怎么回事?
解决方案1:
把工程设置里面的C++选项页中的“Preprocessor definitions"里的_ATL_MIN_CRT去掉就可以了
解决方案2: CAUSE
Builds in release mode automatically include the preprocessor directive _ATL_MIN_CRT, while the default ATL service code generated by the wizard requires the CRT library.
RESOLUTION
Remove _ATL_MIN_CRT from the list the preprocessor defines to allow CRT startup code to be included.
From the Project menu, click Settings.
In the Settings For drop-down list, select Multiple Configurations.
In the Select project configuration(s) to modify dialog box that displays, select the check boxes for all release versions, and then click OK.
Click the C/C++ tab in the Project Settings dialog box, and then choose the General category.
Remove _ATL_MIN_CRT from the Preprocessor definitions edit box.
_ATL_MIN 去掉