一个C++具简单的问题
不好意思,我没有分了
为什么我这么简单的代码vs2005老是编译不了,是CString还是编译器哪里的问题呢
#include <iostream>
using namespace std;
class CPbItem
{
CString m_strLocation;
};
}
void main()
{
}
输出是:
C:\Documents and Settings\Administrator\桌面>cl d.cpp
用于 80x86 的 Microsoft (R) 32 位 C/C++ 优化编译器 14.00.50727.42 版
版权所有(C) Microsoft Corporation。保留所有权利。
d.cpp
D:\Program Files\Microsoft Visual Studio\VC\INCLUDE\xlocale(326) : warning C4530
: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc
D:\Program Files\Microsoft Visual Studio\VC\INCLUDE\xlocale(341) : warning C4530
: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc
D:\Program Files\Microsoft Visual Studio\VC\INCLUDE\xlocale(358) : warning C4530
: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc
D:\Program Files\Microsoft Visual Studio\VC\INCLUDE\istream(1075) : warning C453
0: 使用了 C++ 异常处理程序,但未启用展开语义。请指定 /EHsc
d.cpp(5) : error C2146: 语法错误 : 缺少“;”(在标识符“m_strLocation”的前面)
d.cpp(5) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
d.cpp(5) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
d.cpp(8) : error C2059: 语法错误 : “}”
d.cpp(8) : error C2143: 语法错误 : 缺少“;”(在“}”的前面)
d.cpp(8) : error C2059: 语法错误 : “}”
d.cpp(10) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)
d.cpp(10) : error C2447: “{”: 缺少函数标题(是否是老式的形式表?)