Trying to learn C++

Paul Smith paul at mad-scientist.net
Thu Oct 17 21:33:00 UTC 2019


On Thu, 2019-10-17 at 16:41 -0400, Stephen wrote:
> With <iostream.h> or <iostream> or with it in quotes I get the same
> thing.
> 
> stephen at DeskTop ~ $ g++ ~/projects/hello.cpp
> /home/stephen/projects/hello.cpp:2:22: fatal error: "iostream": No
> such file or directory
> compilation terminated.
> stephen at DeskTop ~ $

I'm not familiar with Mint since I use Ubuntu, but it would surprise me
if Mint was different in this area than Ubuntu.

The C++ STL headers are prerequisites of the standard compiler package,
so it's also surprising to me that you wouldn't have them since you
have a C++ compiler, unless you installed it via some low-level package
rather than the standard compiler package.

All you should have to do to get a full C++ compiler environment based
on GCC is to run this:

  $ sudo apt install g++

and that should depend on (and thus import) all the other packages you
need to compile C++ code, including the STL headers like iostream.

That's certainly true on my Ubuntu 18.04 system.





More information about the ubuntu-users mailing list