C++ - Fedora Linux上的gcc

Sim*_*ity 0 c++ gcc fedora

我正在尝试运行一个简单的Hello World!Fedora Linux通过terminal使用程序在系统上gcc,并获得以下内容:

[abder-rahman@Abder Desktop]$ gcc hello.cpp

hello.cpp:1:22: fatal error: iostream.h: No such file or directory compilation terminated.
Run Code Online (Sandbox Code Playgroud)

这是为什么?出了什么问题?

谢谢.

Fre*_*Foo 6

  1. 您应该编译C++程序g++,而不是gcc.
  2. iostream.h标准C++中没有标题.它iostream(虽然iostream.h可以提供与古代C++代码的向后兼容性).