Why can't g++ find iostream.h?

后端 未结 3 612
醉酒成梦
醉酒成梦 2020-11-27 20:06

I\'m trying to understand how to compile C++ programs from the command line using g++ and (eventually) Clang on Ubuntu.

I found a webpage which explains MakeFiles an

3条回答
  •  不知归路
    2020-11-27 20:46

    Before the C++ language was standardized by the ISO, the header file was named , but when the C++98 standard was released, it was renamed to just (without the .h). Change the code to use #include instead and it should compile.

    You'll also need to add a using namespace std; statement to each source file (or prefix each reference to an iostream function/object with a std:: specifier), since namespaces did not exist in the pre-standardized C++. C++98 put the standard library functions and objects inside the std namespace.

提交回复
热议问题