VS2005编C++出错,无法打开包括文件:“iostream.h”

Kahless312 2007-11-27 12:04:01
我用VS2005编C++,结果很简单的程序都出错,
#include<iostream.h>
void main()
{
cout<<"aaaa"<<endl;
}
运行出现“无法打开包括文件:“iostream.h”: No such file or directory”的错误------已包含“iostream.h”。

然后在#include<iostream.h>上面加上“using namespace std;”
运行出现:
“error C2871: “std”: 具有该名称的命名空间不存在”

#include<iostream>一样的错误。

哪位知道的大哥说一下。

解决立即结帖。
...全文
8026 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
cloudlgh 2011-05-23
  • 打赏
  • 举报
回复
#include <iostream>即可,只是我很奇怪,这有什么区别。
ylyfxzsx 2010-08-06
  • 打赏
  • 举报
回复
#include <iostream>
using namespace std;

//struct my

class my
{
public:
int x;
int y;
int output()
{

cout<<x<<endl<<y <<endl;
return 0;

}
};

int main()
{

my pt;
pt.x =5;
pt.y =5;

//cout<<pt.y <<endl<<pt.y <<endl;
pt.output();
getchar();

return 0;
}
oscarhx 2009-03-06
  • 打赏
  • 举报
回复
//#include <iostream.h>
#include <iostream>
using namespace std;
ljt275271279 2008-11-16
  • 打赏
  • 举报
回复
//#include <iostream.h>
#include <iostream>
using namespace std;
visame 2007-12-01
  • 打赏
  • 举报
回复
这个我还没用过VS6以后的产品呢.
学习一下。
晨星 2007-11-27
  • 打赏
  • 举报
回复
楼主看的书太老了。
新标准98年就出来了,你看的书还在讲98年前的C++,换一本吧。
loops 2007-11-27
  • 打赏
  • 举报
回复
此外,建立工程的时候,选择建立:win32 console application,这样的话,再
#include <iostream>
using namespace std;
就应该没问题了。
loops 2007-11-27
  • 打赏
  • 举报
回复
#include <iostream>
using namespace std;呢?
effective_person 2007-11-27
  • 打赏
  • 举报
回复
无法打开包括文件:“iostream.h”: No such file or directory”的错误------已包含“iostream.h”。

确实不能因为vs2005支持标准c++
加“using namespace std;” 还不能是不可能吧
可能是你建错工程或 该大麦放在.h文件中
飞哥 2007-11-27
  • 打赏
  • 举报
回复
#include <iostream>
using namespace std;

2005好多东西都不用了,像什么.h的头文件基本抛弃了,即使能用也一堆警告
ckt 2007-11-27
  • 打赏
  • 举报
回复
把使用#include <iostream.h>
都换成

#include <iostream>
using namespace std;
l_clove 2007-11-27
  • 打赏
  • 举报
回复
#include <iostream>
yuyunliuhen 2007-11-27
  • 打赏
  • 举报
回复
#include <iostream.h>
过时的标准,该改改啦 ^_^ VC2003就已经开始不支持了
rodsgo 2007-11-27
  • 打赏
  • 举报
回复
是C99标准吧?
飞哥 2007-11-27
  • 打赏
  • 举报
回复
选本简单的实践性强的书
懒得打字 2007-11-27
  • 打赏
  • 举报
回复
#include <iostream>

using namespace std;

int main()
{
// 实现
return 0;
}


ANSI/ISO C++
xugang_2001 2007-11-27
  • 打赏
  • 举报
回复
<<C++ Primer 5nd>> C++学习 强烈推荐
Kahless312 2007-11-27
  • 打赏
  • 举报
回复
steedhorse 发表于:2007-11-27 00:18:23 4楼
楼主看的书太老了。
新标准98年就出来了,你看的书还在讲98年前的C++,换一本吧。



好像是噢,我现在用的是《面向对象的理论与C++实践》,清华出版的,第一版时间是97年

请推荐一本书,万分感激

64,652

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧