首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

vs2010未声明的标识符,该怎么处理

2013-02-24 
vs2010未声明的标识符// myfirst.cpp--displays a message#include stdafx.h// a PREPROCESSOR directiv

vs2010未声明的标识符
// myfirst.cpp--displays a message

#include <stdafx.h>                           // a PREPROCESSOR directive
int main()                                    // function header
{                                             // start of function body
    using namespace std;                      // make definitions visible
    cout << "Come up and C++ me some time.";  // message
    cout << endl;                             // start a new line
    cout << "You won't regret it!" << endl;   // more output
// If the output window closes before you can read it,
// add the following code:
    // cout << "Press any key to continue." <<endl;
// cin.get();                                                   
    return 0;                                 // terminate main()
}                                             // end of function body

1>------ 已启动生成: 项目: ConsoleApplication9, 配置: Debug Win32 ------
1>  ConsoleApplication9.cpp
1>c:\users\time\documents\visual studio 2012\projects\consoleapplication9\consoleapplication9\consoleapplication9.cpp(7): error C2065: “cout”: 未声明的标识符
1>c:\users\time\documents\visual studio 2012\projects\consoleapplication9\consoleapplication9\consoleapplication9.cpp(8): error C2065: “cout”: 未声明的标识符
1>c:\users\time\documents\visual studio 2012\projects\consoleapplication9\consoleapplication9\consoleapplication9.cpp(8): error C2065: “endl”: 未声明的标识符
1>c:\users\time\documents\visual studio 2012\projects\consoleapplication9\consoleapplication9\consoleapplication9.cpp(9): error C2065: “cout”: 未声明的标识符
1>c:\users\time\documents\visual studio 2012\projects\consoleapplication9\consoleapplication9\consoleapplication9.cpp(9): error C2065: “endl”: 未声明的标识符
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========





大家怎么看? header
[解决办法]
你再装一遍vs试一下。。。我用的vc6.0,有时候出现各种莫名其妙的错误都会再装一次。。。

热点排行