Cannot open include file: 'iostream': No such file or directory

lfofiug 2008-05-23 05:54:42
无论我写什么样的代码,总会出现这样一个问题;
d:\vc++\在\d.cpp(1) : fatal error C1083: Cannot open include file: 'iostream': No such file or directory
我想请问这是什么?
谢谢!
...全文
9462 26 打赏 收藏 转发到动态 举报
写回复
用AI写文章
26 条回复
切换为时间正序
请发表友善的回复…
发表回复
hbmywuwenmei 2012-04-22
  • 打赏
  • 举报
回复
我也遇到过这样的问题,你可以用code blocks这个软件,比vc好一点
wulixiaodao 2012-03-07
  • 打赏
  • 举报
回复
好使
[Quote=引用 19 楼 hejsea 的回复:]

按照这种方法我解决了问题:

可能很多人在安装VC 6.0后有过点击“Compile”或者“Build”后被出现的
“Compiling... ,Error spawning cl.exe”错误提示给郁闷过。很多人的
选择是重装,实际上这个问题很多情况下是由于路径设置的问题引起的,
“CL.exe”是VC使用真正的编译器(编译程序),其路径在“VC根目录\VC98\Bin”下面,……
[/Quote]
朱文祥 2011-11-29
  • 打赏
  • 举报
回复
改成
#include<iostream>
using namespace std;
seashell126 2011-11-28
  • 打赏
  • 举报
回复
我也遇到过同样的问题,最好还是重新下一个VC吧
hlduan2004 2011-10-11
  • 打赏
  • 举报
回复
16楼的答复能解决vc2008里面的报错。
jiesolo119 2011-05-30
  • 打赏
  • 举报
回复
在EVC中出现这种情况怎么解决呢?
sdzcwx 2011-05-24
  • 打赏
  • 举报
回复
看了那么多,还是不会弄。。。
hejsea 2010-09-21
  • 打赏
  • 举报
回复
按照这种方法我解决了问题:

可能很多人在安装VC 6.0后有过点击“Compile”或者“Build”后被出现的
“Compiling... ,Error spawning cl.exe”错误提示给郁闷过。很多人的
选择是重装,实际上这个问题很多情况下是由于路径设置的问题引起的,
“CL.exe”是VC使用真正的编译器(编译程序),其路径在“VC根目录\VC98\Bin”下面,
你可以到相应的路径下找到这个应用程序。

因此问题可以按照以下方法解决:打开vc界面 点击VC“TOOLS(工具)”—>“Option(选择)”
—>“Directories(目录)”重新设置“Excutable Fils、Include Files、
Library Files、Source Files”的路径。很多情况可能就一个盘符的不同
(例如你的VC装在C,但是这些路径全部在D),改过来就OK了。
链接来源:http://hi.baidu.com/271032830/blog/item/342f70bf3a973d0e19d81ff7.html

路径不好定位的话,你全盘搜索 iostream文件,在对应lib、bin等文件即可。
Zero0009 2010-04-28
  • 打赏
  • 举报
回复
我用的c-free也遇到了这样的问题,怎么解决啊?
ls2098 2010-01-25
  • 打赏
  • 举报
回复
我用evc编译器也出现这种情况了 请教各位大虾 怎么弄呀
窗外一棵树 2008-09-04
  • 打赏
  • 举报
回复
#include <iostream.h >

这个是VC6以前的写法。

#include <iostream >
using namespace std;

这个是标准库的写法。标准库把这些个文件都放到std这个namespace里面了。

可以到VC\include看看和VC6.0的区别,是iostream而不是iostream.h。

注意<iostream>和<iostream.h>是两个不同的东西
<iostream>是STL库
<iostream.h>是兼容于c的库
所有STL库都在std::名空间下
std::cout是<iostream>里面的对象

namespace std: 所有的C++ Standard Library Class都包含在这个叫std的name
space里。比如<vector>,<iostream>,<iterator>等等。所以当你使用它们其中的class时
,需要加入这个语句,using namespace std; 不然编译器报错。

例:
#include<iostream>
using spacename std;
int main()
{
std::cout<<"hello world"<<std::endl;
return 0;
}
chenhu_doc 2008-05-24
  • 打赏
  • 举报
回复
学标准的 c++就不用vc6.0了,
直接去找vs2005 RTM
lfofiug 2008-05-23
  • 打赏
  • 举报
回复
这个是我下的编译器,vc++6.0,是一个压缩包,解压之后不是一个可执行的程序,而是自动成的文件,
哪位能提供一个好的地方,下一个vc++6.0
谢谢!
chenhu_doc 2008-05-23
  • 打赏
  • 举报
回复
用过vs2005后,发现包含头文件用"....h"和<....h>是被强制区分了的。
kongsanwen 2008-05-23
  • 打赏
  • 举报
回复
#include <iostream>
using namespace std;
void accept(char *,int *,float &);
void display(char *,int ,float );
int main()
{
char cname[20];
int iage;
float fsalary;
accept(cname,&iage,fsalary);
display(cname,iage,fsalary);
return 0;
}
void accept(char *name,int *age,float &salary)
{
cout <<"enter name;" <<endl;
gets(name);
cout <<"enter age;" <<endl;
cin>>*age;
cout <<"enter salary" <<endl;
cin>>salary;
}
void display(char* name,int age,float salary)
{
cout <<"information;" <<endl;
cout <<name;
cout <<age;
cout <<salary;
}
HelloDan 2008-05-23
  • 打赏
  • 举报
回复
你重装编译器好过。
kongsanwen 2008-05-23
  • 打赏
  • 举报
回复
#include <iostream>
using namespace std;
void accept(char *,int *,float &);
void display(char *,int ,float );
int main()
{
char cname[20];
int iage;
float fsalary;
accept(cname,&iage,fsalary);
display(cname,iage,fsalary);
return 0;
}
void accept(char *name,int *age,float &salary)
{
cout <<"enter name;" <<endl;
gets(name);
cout <<"enter age;" <<endl;
cin>>*age;
cout <<"enter salary" <<endl;
cin>>salary;
}
void display(char* name,int age,float salary)
{
cout <<"information;" <<endl;
cout <<name;
cout <<age;
cout <<salary;
}
lfofiug 2008-05-23
  • 打赏
  • 举报
回复
没有装java
很急啊;
jintianfree 2008-05-23
  • 打赏
  • 举报
回复
是不是装了java,设置了环境变量
lfofiug 2008-05-23
  • 打赏
  • 举报
回复
#include<iostream>
using namespace std;
void accept(char &,int *,float &);
void display(char ,int ,float );
int main()
{ char cname[20];
int iage;
float fsalary;
accept(cname[20],&iage,fsalary);
display(cname[20],iage,fsalary);
return 0;
}
void accept(char &name,int *age,float &salary)
{ cout <<"enter name;"<<endl;
cin>>name;
cout <<"enter age;"<<endl;
cin>>*age;
cout <<"enter salary"<<endl;
cin>>salary;
}
void display(char name[],int age,float salary)
{ cout <<"information;"<<endl;
cout <<name;
cout <<age;
cout <<salary;
}
这是我写书上一个例子,应该没有问题吧,
加载更多回复(6)

64,654

社区成员

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

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