[dundee] C++

Mark Harrigan dundee at lists.lug.org.uk
Sun Feb 23 00:29:01 2003


Keir Lawson wrote:

> Could some one recommend to me a book for learning C++ (i already know 
> a bit of java) that has an emphasis on linuc ie GCC
>
> thanks
>
> from keir 

I think you may be limiting yourself by wanting a book specifically on 
the Linuxy/GCC side for the time being, to learn the language I'd 
recommend looking at Accelerated C++, 
http://www.amazon.co.uk/exec/obidos/ASIN/020170353X/ref=sr_aps_books_1_1/202-4122623-5463004.
It's not OS specific but is an excellent introduction to C++ and how it 
should be used. Most books don't actually utilise the full power of C++ 
as they put procedural and C premises on C++ that aren't valid and are 
quite unhelpful imho.

For the required GCC knowledge I'd recommend man g++ as it's quite 
simple, for single file programs it's as easy as g++ -ansi -Wall -o 
example example.cc

g++ is a script to start gcc in C++ mode.
-ansi enforces ansi/iso compliance
-Wall prints all possible error messages generated
-o the output file ie your final program
and example.cc is the source of the file.

When you get into multi-file programs you'll need to familiarise 
yourself with make, this is best done with the docs that are supplied 
with make, which should be on your hard disk already.

Of course you should also be using vim to code all this in :)
However if you felt more comfortable using a more modern IDE you have 
the choice of:
Anjuta - Gnomes IDE 
http://freshmeat.net/projects/anjuta/?topic_id=65%2C58%2C45 or
KDevelop - KDE IDE 
http://freshmeat.net/projects/kdevelop/?topic_id=65%2C57%2C45
There are other IDE's but these are the biggies, note however that they 
are very similar to each other.

I hope that this is useful to start you off.