PDA

View Full Version : C++ compilers for Ubuntu


TitanEG
September 10th, 2008, 07:21 PM
Hi folks,
I am a noob to Ubuntu. I am building a PC and plan on making it a Ubuntu PC. I have been teaching myself C++ and have been using the dev-C++ and MS Visual C++ compilers. I'd like to continue on learning to program in C++ but my question is this: what are some good C++ compilers for Ubuntu.
Thanks!!!

damoxc
September 10th, 2008, 07:22 PM
I'd have a look at gcc if I were you, the GNU C and C++ compiler.

cmay
September 10th, 2008, 07:24 PM
sudo apt-get install build-essential
this is the best c and c++ compiler i know. its free also.
its the standard gcc compiler for linux. there is also a programming talk section in these forums. ask there if you get stuck
good luck :)

Joeb454
September 10th, 2008, 07:24 PM
Actually the C++ compiler is called g++

You can install both by installing build-essential (apt://build-essential) using sudo apt-get install build-essential

inportb
September 10th, 2008, 08:39 PM
Yeah, build-essential is a basic compilation environment; it's works well ;p

damoxc
September 10th, 2008, 08:55 PM
Actually the C++ compiler is called g++

You can install both by installing build-essential (apt://build-essential) using sudo apt-get install build-essential

I was going by man :)

From man g++:
gcc - GNU project C and C++ compiler

Cenotaph
September 10th, 2008, 09:02 PM
iirc dev-c++ uses gcc from mingw so you probably already have some experience with gcc even if you are not aware of it.

if you're looking for an IDE that's another story.

but in linux, for c/c++ programming, gcc is almost mandatory hehe. i think this thread is on the wrong forum however

Joeb454
September 10th, 2008, 09:05 PM
I was going by man :)

From man g++:
gcc - GNU project C and C++ compiler

I think g++ is part of gcc. But to actually compile the code, I always use gcc for C, and g++ for C++

inportb
September 10th, 2008, 09:08 PM
I believe gcc and g++ can be used interchangeably, with the appropriate commandline options -- gcc defaults to C and g++ defaults to C++.

Cenotaph
September 10th, 2008, 09:13 PM
you can use gcc for both, if the file extension is .cpp instead of .c the gcc command will compile as if it was g++