[Wolves] C++ Compiler

Jono Bacon jono at jonobacon.org
Sun Jul 18 01:05:35 BST 2004


Tim T Humpherson wrote:

>  
>  
> I am running a SuSE 9.1 Pro, and I can't find a C++ 
> Programming/Compiler on the menus.  Is it KDevelop? 
>  
> What I wanted is to start learning C++ and I have a book on C++ 
> programming and I would like to start off with a simple C++ programs, 
> but which program do I use on this Linux that I am using?
>  
>
When you want program in C++, you will need a number of different 
things. You will first need  a compile (this converts you code into a 
program you can run). The compiler is typically g++ which is part of the 
common gcc suite of compilers. In addition to this, people often use 
special tools for organising how complex programs are compiled - these 
are called build tools and include automake and autoconf. You don't need 
to worry about these so much at the moment.

KDevelop is a special environment that can be used to create different 
types of software (KDe/GNOME/Command line etc.) and it provides an 
interface to the compiler and other tools.

I would recommend that for simple C++ programs that you type your 
programs into a simple text editor and compile them with a command. As 
an example, type this into a file called first.cpp:

#include 
<iostream.h>>                                                                                                                                       

                                                                                                                                                             

int 
main()                                                                                                                                                   

{                                                                                                                                                            

                                                                                                                                                             

   cout << "Hello 
Tim!";                                                                                                                                     

                                                                                                                                                             

}

Then type the following command:

g++ -o first first.cpp

This will create a program called 'first'. Run it with:

./first

You will then see 'Hello Tim!' appear on your screen.

    Jono

PS - Could you have a look in your email program or webmail settings and 
change the setting so that you send you mails in plain text and not 
HTML. Cheers. :)

-- 
Jono Bacon - http://www.jonobacon.org/
Writer / Journalist / Consultant / Developer




More information about the Wolves mailing list