#include <iostream.h>
#include <afx.h>//CString结构的头文件afx.h
void main()
{
CString str="abc";
str.MakeUpper();//转为大写
cout<<str<<endl;
}
在调试c++程序时,出现错误提示:
1.error C2065: 'CString' : undeclared identifier或
2.nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
处理办法:
1.检查是否包含头文件afx.h
2.打开project->settings->general->microsoft foundation classes->
选use MFC in a static library
或选 use MFC in a shared DLL(需要把MFC的动态库放在system32文件夹下) .
详情请参考:
http://www.data10000.com/bbs/thread-80-1-317.html
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
本文介绍了解决C++编程中使用CString时遇到的编译错误问题,包括未声明标识符和未解析的外部符号错误,并提供了详细的解决步骤。
1万+

被折叠的 条评论
为什么被折叠?



