Build ATL project in debug mode, it’s okey. But in Release Mode, it shows the following message:
Creating library ReleaseMinSize/BTBoxATL.lib and object ReleaseMinSize/BTBoxATL.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseMinSize/ABCATL.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
ABCATL.dll - 2 error(s), 0 warning(s)
- remove the symbol _ATL_MIN_CRT from the release configurations
- remove all dependencies on the C run-time library
In ATL programming guild, developers shouldn’t use CRT functions. So, the atl wizard add the symbol _ATL_MIN_CRT to release mode configurations for the main reason, to reduce the size of executable, about 25K saved. _ATL_MIN_CRT symbol also solves the dependency on MSVCRT.dll problem without having to statically link CRT into executable.