#### Archived

This topic is now archived and is closed to further replies.

# Stupid noob? Does GCC do C++

This topic is 5989 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Okay, I know it''s a stupid question, but I know that there is gcc, and g++. Does that mean that if I want to compile in the C++ language that I have to use g++? And if so, where in the hell do I find it? I tried rpmfind.net but couldn''t find it. I did find a debian package for it, but I''m not sure if my mandrake or SuSe system can handle those. Also, does anyone have experience with any of the IDE''s out there? I prefer gnome to KDE, so something that runs under gnome would be nice. And does anyone know if egcs is better than gcc or g++? Thanks

##### Share on other sites
gcc is the GNU C Compiler supports c++ too :D

##### Share on other sites
GCC actually now stands for the GNU Compiler Collection. It''s a frontend to several language compilers - g++ for C++, gcj for Java, g77 for Fortran77, cc for C, obj-c or so for Objective-C. For full documentation type
info gcc

at a terminal prompt.

GCC should have been installed with your system because compilation is such an integral part of running Linux (installing most software requires the ''autoconfig; make; make install;'' cycle). Type
which gcc

at the terminal prompt to find out where the ''gcc'' executable file lives. If it returns ''file not found'' then you know you don''t have it installed. AT RPMFind.net, type gcc in the search box and it will return the names of packages that contain gcc. Look for the one for your distro and version, and then check for its dependencies. Grab all the necessary RPMs and go install.

##### Share on other sites
g++ is just a wrapper around gcc. The only difference is that g++ always expects C++ sources, while gcc decides based on the file extension (and commandline switches).

cu,
Prefect

One line of sourcecode says more than a thousand words.

##### Share on other sites
quote:
Original post by Prefect
g++ is just a wrapper around gcc.

Got that backwards, dude. gcc is the front end to g++ and many other compilers. See post above yours.

##### Share on other sites
Cool beans, thanks everyone.

So gcc is actually a front end for the compilers? That''s pretty neat. Now if only there was a good IDE to use I dread the prospect of having to do command line compiling and linking (sheesh, I don''t even understand debugging in VC++....I can''t imagine what gdb must be like). But oh well, it''s free, and you can''t beat that.

##### Share on other sites
IDEs: KDevelop (KDE), Anjuta (GNOME).

##### Share on other sites
gdb is not that hard, but I would use either DDD ,xxgdb or so other more graphical debuger.

Some IDE''s to look are kdevelop, anjuta, kdestudio,gide and more.

some like to use (x)emacs as IDE.

but before you start to use IDE it''s good to know what really is
happening behind it.

##### Share on other sites
quote:
Original post by Oluseyi
IDEs: KDevelop (KDE), Anjuta (GNOME).

I''m not 100% sure but I think that KDevelop works also under GNOME (even if it was initialy developed for KDE). You certainly cannot use the dialog editor but the IDE itself should work (you may need Qt though).

##### Share on other sites
I like KStudio too. It seems a little simpler than Kdevelop, although the command line is still the best way in my opinion.

##### Share on other sites
quote:
Original post by Oluseyi
gcc is the front end to g++ and many other compilers.

Well, I didn''t want to overcomplicate things, and what I said was - well - oversimplificated and probably enough for most people. If you want to be anal: both gcc and g++ are front-ends to a bunch of different tools, namely:
- the preprocessor (cpp)
- the actual, versatile compiler (cc1)
- the assembler (as)

Run gcc -v --help and g++ -v --help if you don''t believe me.

cu,
Prefect

One line of sourcecode says more than a thousand words.

##### Share on other sites
quote:
Original post by Dauntless
Okay, I know it''s a stupid question, but I know that there is gcc, and g++. Does that mean that if I want to compile in the C++ language that I have to use g++?

And if so, where in the hell do I find it? I tried rpmfind.net but couldn''t find it. I did find a debian package for it, but I''m not sure if my mandrake or SuSe system can handle those.

Also, does anyone have experience with any of the IDE''s out there? I prefer gnome to KDE, so something that runs under gnome would be nice. And does anyone know if egcs is better than gcc or g++?

Thanks

First of all, your first assumption is right, if you want to compile C++ code, you have to use g++ which is a system default on any distro. For your information, g++ is part of the same package as gcc.

As for egcs, it is a pretty good compiler but I prefer sticking to gcc/g++. Now, as for your IDE question, use Anjuta. it''s one of the easiest IDE to use and it works on Gnome and KDE and all WMs. Although, if you prefer KDevelop, it does work on Gnome also and there are no penalties. Trust me, I''m a Gnome user also and it works just fine for me when I need it. Also, another good IDE although a bit hard to understand at first is EMACS. Ok, I hear you saying "but emacs is just a text editor", that''s true also but it has alot of functions that you find in good IDEs. Including syntax highliting, auto-indent, etc. I use it alot also. I guess I choose an IDE depending on my moods. Anyhow, hope this helps out...

"And that''s the bottom line cause I said so!"

Cyberdrek
A division of DLC Multimedia

Resist Windows XP''s Invasive Production Activation Technology!

"gitty up" -- Kramer

##### Share on other sites
quote:
Original post by Cyberdrek
....I hear you saying "but emacs is just a text editor"...

That''s a good point. Emacs is waaaay more than just a text editor; Emacs is a complete virtual environment, with integrated command-line, email capabilities, a complete help system and all the things Cyberdrek mentions. It takes a while to get used to it, but once you do it''s extremely powerful.