Trying to learn C++

Volker Wysk post at volker-wysk.de
Thu Oct 17 21:10:57 UTC 2019


Hi!

Am Donnerstag, den 17.10.2019, 16:41 -0400 schrieb Stephen:
> I'm trying to learn Cpp programing on Linux Mint 18.3 which is based
> on 
> Ubuntu 16.04.

That's a wise decision.  :-)

> Every time I try to compile a source file that has #include
> <iostream> I 
> get a message saying that it can't find iostream. I tried using 
> iostream.h and it had the same effect.
> 
> I tried "using namespace std;". I got a lot of lines saying that
> such 
> and such was not a member of std::???
> 
> 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.

This looks like the C++ environment isn't installed right. Have you
installed the standard C++ library? This would be the package
"libstdc++-8-dev". When you don't have this, try an earlier version,
such as "libstdc++-7-dev" or "libstdc++-6-dev".

> stephen at DeskTop ~ $
> 
> I would really like to learn c++ programing, but I have to fix this
> so I 
> can use the book C++ in 21 days.

Good luck!

Volker





More information about the ubuntu-users mailing list