PDA

View Full Version : c++ compiler?


karmah
June 16th, 2005, 08:46 AM
I used to program c++ when i had windows. Now I want to do it in Ubuntu too but I can't..I've failed installing devcpp for linux and i can't use 'gcc <file.cpp>' to compile...
I'm a linux-noob so you might have to gimme a little step-by-step walkthrough :)
as usual: thx in advance anyone.

thumper
June 16th, 2005, 08:55 AM
gcc is a C compiler. To compile C++ you need to use g++.

My 3.4.1 install of gcc installed /usr/bin/g++-3.4 which I sym-linked to g++ so normal build scripts / makefiles found it automatically.

karmah
June 16th, 2005, 09:00 AM
Thx, so ok..hmm..i compiled it i think...where did the program end up then? it's not in the same folder

stubby
June 16th, 2005, 09:20 AM
Thx, so ok..hmm..i compiled it i think...where did the program end up then? it's not in the same folder
Sure? If i remember right normally it's called something like a.out

If you want to name the file it outputs to, just add a -o flag
eg.
g++ -o myoutput myfile.cpp

karmah
June 16th, 2005, 09:25 AM
YAY! Thank you very much, dewd!

leohart
July 1st, 2005, 10:49 AM
gcc is a C compiler. To compile C++ you need to use g++.

My 3.4.1 install of gcc installed /usr/bin/g++-3.4 which I sym-linked to g++ so normal build scripts / makefiles found it automatically.

Thanks thumper, you saved me big time. Was trying to figure out why gcc doesn't work with my C++ Helloworld.

However, I like the a little IDE. I looked around and saw KDevelop. I got it through Synaptic. And now when I start a new project I chose HelloWorld project in KDevelop new project wizard.

Whoa, they gave me the code and the comments and everything. Looks awesome. I go Build -> Compile Project and WHAM :-> Error ?

I don't get it :(

thumper
July 2nd, 2005, 01:31 AM
Thanks thumper, you saved me big time. Was trying to figure out why gcc doesn't work with my C++ Helloworld.

However, I like the a little IDE. I looked around and saw KDevelop. I got it through Synaptic. And now when I start a new project I chose HelloWorld project in KDevelop new project wizard.

Whoa, they gave me the code and the comments and everything. Looks awesome. I go Build -> Compile Project and WHAM :-> Error ?

I don't get it :(
OK. What is the error then?

poskok
July 8th, 2005, 10:41 AM
Thak you boys, for this site!