fatal error C1189

fatal error C1189: #error :   Building MFC application with /MD (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD
这是由于VS2005默认的MFC程序是使用动态MFC库(Use MFC in a Shared DLL)来链接的而动态MFC库使用的是Multi-threaded DLL (/MD),由于XP对于PE文件格式监测更加严格,所以要进行如下的项目设置修改: 
[Project Properties] -->[Configuration Properties] --> [c/c++] -->[Code Generation]-->[RunTime Library]这里要改成[Multi-threaded (/MT)] 
再编译,通过了,但出现了一个Link错误:

corelibc.lib(wwinmain.obj) : error LNK2019: unresolved external symbol wWinMain referenced in function wWinMainCRTStartup
现在要做如下修改,因为程序默认Entry Point找不到了,重新打开项目设置 
Project Properties] -->[Configuration Properties] --> [Linker]-->[Advanced]-->[Entry Point]-->把[wWinMainCRTStartup]改成[WinMainCRTStartup]  

你可能感兴趣的:(c/c++,c++小技巧)