Trying to learn C++

Robert Heller heller at deepsoft.com
Fri Oct 18 00:04:17 UTC 2019


At Thu, 17 Oct 2019 16:41:49 -0400 "Ubuntu user technical support,  not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:

> 
> 
> I'm trying to learn Cpp programing on Linux Mint 18.3 which is based on 
> Ubuntu 16.04.
> 
> 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.

You probably need the -dev package installed (probably many -dev packages 
installed).  Most (typical) Desktop Linux distros don't install all of those 
packages, since most users are only going to be reading E-Mail, surfing the 
web, and writing documents (eg use LibreOffice).

For <iostream> you want libstdc++-dev.  You will also need libc-dev.  And 
likely others (eventually).

Open a termina and type:

sudo apt-get install libstdc++-dev libc6-dev



> 
> 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.
> 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.
> 
> Thanks in advance
> 
> Stephen.
> 
> 
> 

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services
                                     




More information about the ubuntu-users mailing list