PDA

View Full Version : c++ programming



hezy00
December 25th, 2008, 03:38 PM
hello,
I've just installed a new ver. of ubuntu. I'ld like to have your advice about which compeiler to use at the beggining? Is there a system-build-in tool for that? thx,
hezy.

namdung
December 25th, 2008, 04:28 PM
There are several IDEs available for C++. Search & install in Add/Remove Applications. Remember to select All available applications.

Take ur pick:
KDevelop
Anjuta IDE
Netbeans

Sorivenul
December 25th, 2008, 08:14 PM
Reading the Programming Talk stickies should help:
How to Learn to Program FAQ, Linux Programming (http://ubuntuforums.org/showthread.php?t=1006666)
Programming Tolls and References (http://ubuntuforums.org/showthread.php?t=1006662)
The short answer about the compiler is "g++", which should be installed with the "build-essential" metapackage. As far as IDEs go, the stickies also offer great suggestions.

Also, unless you are using C++ for university coursework or something similar, I wouldn't suggest beginning with C++. The stickies offer many suggestions of how to get yourself started, and the community here is very good.

Good luck!

tseliot
December 26th, 2008, 09:09 PM
Moved to the Programming Talk.

jimi_hendrix
December 27th, 2008, 03:05 AM
use gedit or vim to write the code then compile with



g++ -o executableName test.cpp tester.cpp
#this is a bash comment (comment in the shell)
#use this to run your new program
./executableName

monkeyking
December 27th, 2008, 03:09 AM
sudo apt-get install build-essentials ...

meanburrito920
December 27th, 2008, 03:34 AM
The compiler and IDE are two separate things.

If you are asking which compiler to use, g++ is the standard. It is already installed with the base system. However, as has been mentioined, it does not include the build-essentials package, which includes basic headers and the such that are needed for compiling your files. monkeyking's post shows how to install build-essentials.

As for IDEs, I would suggest that you begin with gedit. It works wonders if you are just beginning, and if not it still has features for the more advanced user. However, if you are a more advance user and you would like to put down some time to learn tools you will always use, look into learning vim or emacs (imho you should go with emacs :-) ).

For compiling your programs, bring up a terminal in the directory your source directory you are in and use g++. If you are unfamiliar with g++, run

$ man g++
or
$ info g++

There are a plethora of options, but it should be relatively easy to figure out what parameters you need.

Hope that helps.