有初学C++者经常会出现如下错误:
fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory。
这个错误一般在使用Visual C++ .NET 2005或以上版本时出现。
原因,iostream.h为C类库,C++类库中应该为iostream。
另外cin,cout等函数在std命名空间中。使用时应加上using namespace std;
解决方法:将#include <iostream.h>
改为#include <iostream>
using namespace std;
fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory。
这个错误一般在使用Visual C++ .NET 2005或以上版本时出现。
原因,iostream.h为C类库,C++类库中应该为iostream。
另外cin,cout等函数在std命名空间中。使用时应加上using namespace std;
解决方法:将#include <iostream.h>
改为#include <iostream>
using namespace std;
本文解决了C++初学者常见的一个编译错误:无法打开'iostream.h'文件。解释了此错误通常发生在使用Visual C++.NET 2005或更高版本时,并给出了正确的头文件引用方法。
762

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



