描述:
编译debug 版 没有问题 但是其他的都不行:(
错误信息如下
----------------Configuration: Popedom - Win32 Release MinDependency--------------------
Compiling...
Popedom.cpp
Linking...
Creating library ReleaseMinDependency/Popedom.lib and object ReleaseMinDependency/Popedom.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseMinDependency/Popedom.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
解决方案1:
Note for Release builds only When the ATL COM AppWizard generates the default project, it defines the macro _ATL_MIN_CRT. This macro is defined so that you don't bring the C Run-Time Library into your code if you don't need it. The polygon control needs the C Run-Time Library start-up code to initialize the floating-point functions. Therefore, you need to remove the _ATL_MIN_CRT macro if you want to build a Release version. To remove the macro, click Settings on the Project menu. In the Settings For: drop-down list, choose Multiple Configurations. In the Select project configuration(s) to modify dialog box that appears, click the check boxes for all four Release versions, then click OK. On the C/C++ tab, choose the General category, then remove _ATL_MIN_CRT from the Preprocessor definitions edit box.
Project->Settings
C/C++页Project Options里有一个_CONSOLE改为_WINDOWS
Link页Project Options里有一个console,改为windows。