想用控制台工程又想使用CString,毕竟方便啊,在VS2008下如果建非MFC工程而又使用CString会出现如下错误:
1、 error C2065: “CString”: 未声明的标识符 解决方法:将#include <afx.h>添加在程序开始处,或将其放在stdafx.h预编译头中。 2、再编译提示: fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] 解决方法:点击项目->属性->配置属性->常规->MFC使用,VS2008默认为 使用标准 Windows 库,将其改为 在共享 DLL 中使用 MFC即可。 做个笔记。 |
http://hi.baidu.com/tianxingjianhd/blog/item/a437d9d0bb32a0369b502799.html