LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-08-2013, 12:53 AM   #1
trackstar2000
Member
 
Registered: Apr 2013
Posts: 50

Rep: Reputation: Disabled
gcc compiler


Hello,

I installed the compiler using yum.

yum install gcc

Is that all I need? The programmer said he is having issue . OS is centos 6.4 The compiler is good for C/C++? I did a 'which cc", its there also. I noticed its a link to gcc.

Last edited by trackstar2000; 08-08-2013 at 12:55 AM.
 
Old 08-08-2013, 01:28 AM   #2
thelinuxist
Member
 
Registered: Nov 2012
Location: Munich, Germany
Distribution: CentOS, Debian, Fedora, Ubuntu, DSL (Whatever neccessary)
Posts: 61

Rep: Reputation: Disabled
What issues he has? gcc itself only contains the C compiler, I think the C++ one is in a seperate package (But maybe I am wrong, I use fedora). If the C++ compiler is installed as well, maybe a library is missing?
Remember that for building things, you usually need the developer version of a package (like "lib*-dev", please don't use THIS as a yum install parameter, it's probably gonna screw up your system!) and the normal version for running it afterwards.
To test whether GCC works, you can use the following:
Code:
echo 'main(){}' > dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'
(copied from http://www.linuxfromscratch.org/lfs/...gcc-pass2.html). If this tells you that there is no a.out, the compiler isn't working. Usually, it should tell you that:
Code:
Requesting program interpreter: /lib/ld-linux.so.2
allowing for /lib/ to be /lib64/ on a 64 Bit OS.

Good hunting for that error.
 
Old 08-08-2013, 01:43 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Usually you need some other tools as the GNU linker ld, the make utility, and so on... You can install all the basic development stuff by means of
Code:
yum groupinstall "Development Tools"
 
Old 08-08-2013, 03:07 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,698

Rep: Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291Reputation: 3291
Quote:
yum install gcc
A standalone gcc is not supposed to work.
None of the required tools / headers are installed.
The minimum is : # yum install gcc-c++
This will also install {glibc-devel glibc-headers kernel-headers},
i.e. the packages that will make up a functional gcc.

More tools : See #3 : # yum groupinstall "Development tools"
Please check the naming with $ yum grouplist
.. Used to be "Development Tools".
Now it's most often the lower case T : tools

-

Last edited by knudfl; 08-08-2013 at 03:08 AM.
 
Old 08-08-2013, 11:00 AM   #5
trackstar2000
Member
 
Registered: Apr 2013
Posts: 50

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
A standalone gcc is not supposed to work.
None of the required tools / headers are installed.
The minimum is : # yum install gcc-c++
This will also install {glibc-devel glibc-headers kernel-headers},
i.e. the packages that will make up a functional gcc.

More tools : See #3 : # yum groupinstall "Development tools"
Please check the naming with $ yum grouplist
.. Used to be "Development Tools".
Now it's most often the lower case T : tools

-
The programmer said if he runs gcc it seems to be expecting a C++ file. I will install both.

yum install gcc-c++
yum groupinstall "Development Tools"


I am guessing no reboot is needed? I am going to test the compiler out myself.
Thanks,
ts

Last edited by trackstar2000; 08-08-2013 at 12:09 PM.
 
Old 08-09-2013, 12:58 AM   #6
trackstar2000
Member
 
Registered: Apr 2013
Posts: 50

Original Poster
Rep: Reputation: Disabled
Just a quick update.

I was able to test the Hello world sample (http://www.network-theory.co.uk/docs...ccintro_9.html) with the C language, but not C++ until I installed (yum install gcc-c++). I also went ahead and installed (yum groupinstall "Development Tools").
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
gcc compiler mreff555 Linux - Software 1 01-17-2013 09:03 AM
[SOLVED] [Question] How to compile a gcc compiler for another machine which got no c compiler on it shone27 Linux - Newbie 9 09-28-2011 07:32 PM
LXer: Compiler Benchmarks Of GCC, LLVM-GCC, DragonEgg, Clang LXer Syndicated Linux News 0 11-08-2010 05:11 PM
C compiler gcc hemi_426 Slackware 19 05-07-2008 12:09 PM
GCC compiler? Forezt Linux - Newbie 2 11-23-2003 02:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration