用WTL的时候想include一个TlHelp32就跟我弹错误信息-.-Release才会,Debug不会
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encoded_null already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __get_osplatform already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __osplatform already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(calloc.obj) : error LNK2005: _calloc already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __set_errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(dosmap.obj) : error LNK2005: __get_errno already defined in atlmincrt.lib(atlinit.obj)
1>LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
解决办法:项目的Property Pages->General->Minimize CRT Use in ATL设置成NO
(针对VC2005,其他版本类推)
Debug下本来就是NO了...Release下默认是YES
WTL Release编译错误一例
最新推荐文章于 2019-09-18 13:30:49 发布