在哪里得到iostream.h

我试图在Linux中做一些事情,但它抱怨说找不到iostream.h。 我需要安装什么来获得这个文件?

这个标准标题的正确名称就是没有扩展名的iostream

如果您的编译器仍然无法find它,请尝试以下操作:

 find /usr/include -name iostream -type f -print 

…并将其添加到您的包含path,遵循您的编译器的文档。

头文件<iostream.h>是一个从C ++标准化为ISO C ++ 1998之前的陈旧头文件(它来自C ++注解参考手册)。 标准的C ++头文件是<iostream>。 这两者之间有一些细微的差别,最大的区别在于<iostream>将包含的内容放在名称空间std中,因此您必须使用“std ::”来限定cin,cout,endl,istream等。 作为一个黑客(这是一个黑客,因为头文件不应该包含“使用”指令,因为它们完全击败名称空间的目的),你可以定义“iostream.h”如下:

 #ifndef HEADER_IOSTREAM_H #define HEADER_IOSTREAM_H #include <iostream> using namespace std; // Beware, this completely defeats the whole point of // having namespaces and could lead to name clashes; on the // other hand, code that still includes <iostream.h> was // probably created before namespaces, anyway. #endif 

虽然这与原来的陈旧的标题不完全相同,但对于大多数目的而言,这应该足够接近(即,应该没有任何东西或者您将不得不修复的东西)。

我需要在debian上编译partport,并有问题(centos 4.5工作正常)我做了这个没有成功ln -s /usr/include/c++/4.5/iostream /usr/include/c++/4.5/iostream.h

我发现iostream.h提供从c + +,我发现它在4.5

所以我从centos 4.5复制到Ubuntu的natty文件iostream.h,它的工作
scp root@ip.centos-4.5:/ usr / include / c ++ / 3.3.4 / backward / iostream.h /usr/include/c++/4.5/iostream.h