LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-03-2009, 01:15 AM   #1
cpthk
Member
 
Registered: Aug 2009
Posts: 31

Rep: Reputation: 15
gcc vs g++ vs gpp ?


Hi:

I used to do programming in linux, but it was a long time ago. I remember I used to have this kind of command:
Code:
gcc test.cpp
I just tried today, and it doesn't work. It output many unreadable error. I searched a bit, it seems I have to use:
Code:
g++ test.cpp
Is it because the command name changed? What's the difference between gcc, g++, and gpp ?

Thanks.
 
Old 09-03-2009, 01:18 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
gcc is for compiling C programs, g++ for C++ ones. g++ links the C++ standard library for one thing (it probably does other things too, but I don't know), while gcc does not. Not sure what gpp is. Perhaps you mean cpp, the C preprocessor? It deals with preprocessor directives (e.g. #include, #define, etc). man cpp for more info.
 
Old 09-03-2009, 06:48 PM   #3
cpthk
Member
 
Registered: Aug 2009
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks for your reply. There is gpp, too. I could do install gpp on my end.
 
Old 09-03-2009, 08:13 PM   #4
joeBuffer
Member
 
Registered: Jul 2009
Distribution: Ubuntu 9.04
Posts: 328

Rep: Reputation: 42
As far as I know, c++ is the same as g++. I could be wrong.
I've never seen g++ used as gpp, personally... Also, I have g++ installed (I installed the build-essential package), and I get the following output:
Code:
joebuffer@ubuntu:~$ g++ --version
g++ (Ubuntu 4.3.3-5ubuntu4) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

joebuffer@ubuntu:~$ c++ --version
c++ (Ubuntu 4.3.3-5ubuntu4) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

joebuffer@ubuntu:~$ gpp --version
The program 'gpp' is currently not installed.  You can install it by typing:
sudo apt-get install gpp
bash: gpp: command not found
When comparing the c++ and g++ files:
Code:
joebuffer@ubuntu:~$ cmp -l /usr/bin/g++ /usr/bin/c++
joebuffer@ubuntu:~$
---
gcc is the C compiler, and gpp I've never seen used in any examples or anything. Everything I've read uses g++, basically all the examples I've seen use g++. It's pretty much standard.

Last edited by joeBuffer; 09-03-2009 at 08:32 PM.
 
Old 09-04-2009, 12:00 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by cpthk View Post
Thanks for your reply. There is gpp, too. I could do install gpp on my end.
Read the description of it then. I've never heard of a "gpp".

Edit: I've found a gpp - general purpose preprocessor: http://en.nothingisreal.com/wiki/GPP...arwinports.com. It's not a compiler, it's a preprocessor.

Last edited by Nylex; 09-04-2009 at 02:06 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing vmware on Open Suse 11.1 - Requires original gcc 4.32 - gcc now 4.3 cyclops.matrix Linux - Software 2 08-31-2009 02:52 PM
Compile error, 'H5G_obj_t' does not name a type, is gcc 4.3 incompatible with gcc 3 ? samrat_rao Linux - Software 5 03-03-2009 02:28 PM
yum install gcc doesn't set the lastest gcc ver 4.3.x kim,jw Linux - Newbie 3 12-22-2008 11:51 PM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 02:13 PM
how to get gpp? J0nathan Slackware 1 12-18-2003 01:59 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration