LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 07-16-2012, 12:14 AM   #1
NM04
Member
 
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 240

Rep: Reputation: 14
Question compiling C programs in fedora


Hi all,
I have a dell inspiron with windows on it and running fedora 16 on VM. The issue is that, i wrote a c program and when i was about to compile I came to know that it didn't had gcc or cc installed. Do I have to install fedora on disk so as to write C or C++ programs?
Please advise on this.

Chelux,
nm
 
Old 07-16-2012, 12:23 AM   #2
rmugunthan
Member
 
Registered: Jan 2009
Location: Coimbatore, India
Distribution: rhel
Posts: 49

Rep: Reputation: 3
u have to install gcc package before compile c programs.

Check whether gcc installed or not using the below command.

rpm -q gcc (or) rpm -qa | grep gcc

The above command didn't give any output means, u have to install gcc package from the OS media.
 
Old 07-16-2012, 12:27 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,362

Rep: Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001
If the VM has internet access you can just use yum to install gcc

yum install gcc

should do it
 
Old 07-17-2012, 11:59 PM   #4
NM04
Member
 
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 240

Original Poster
Rep: Reputation: 14
rmugunthan,
yup it said the package is not installed. Need to install it somehow.

Regards,
nm
 
Old 07-18-2012, 01:17 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,986

Rep: Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447
Better yet ,instead of just hopping that yum will pull ALL the needed prerequisites from just asking to install gcc
AND the odds and ends needed that are NOT prerequisites of gcc .

on fedora it is advised to install the development groups

Code:
su -
yum grouplist
--- then from that list install the development tools ---
yum groupinstall " Development Tools" "Development Librarys"
 
1 members found this post helpful.
Old 07-18-2012, 04:32 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
.. And the absolute minimum to get a working gcc :

1) su <password> 2) yum install gcc-c++

Then the 'gcc' required packages will be install too :
namely glibc-devel, glibc-headers, ( + glibc-common ).

.
 
Old 07-19-2012, 01:11 AM   #7
NM04
Member
 
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 240

Original Poster
Rep: Reputation: 14
John & knudfl,
thank you for your responses, but whatever you have suggested, will it work on Fedora 16 running on VM 8.

regards,
nm
 
Old 07-19-2012, 01:30 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,986

Rep: Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447
we both gave you the instructions for fedora
except you WILL need the " -" after the "su"

on fedora you will need to use "su -" most of the time
 
Old 07-19-2012, 01:30 AM   #9
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
Quote:
John & knudfl,
thank you for your responses, but whatever you have suggested, will it work on Fedora 16 running on VM 8.
As long as you have an internet connection or access to the install DVD. "yum" is a like Apple AppStore for Linux. It exist since a decade and work fine.
 
Old 07-19-2012, 01:39 AM   #10
NM04
Member
 
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 240

Original Poster
Rep: Reputation: 14
elv13,
thank you for your response, i have used yum before but didn't know that it can be used with the install CD/DVD. Thanks again i will do it, will post again if found anything beyond my knowledge.

regards,
nm
 
  


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
Compiling C Programs in Fedora Mohammed Akram Fedora 13 11-20-2007 03:33 PM
Compiling C programs in Fedora Core 2 dreamydinesh Linux - Software 4 10-03-2005 02:51 AM
Compiling Programs Thorrn4 Linux - Software 6 03-26-2005 01:25 AM
Compiling C++ programs rchillal Linux - Newbie 13 02-08-2005 06:27 AM
Compiling Programs Jabber63 Linux - Software 3 08-06-2003 03:58 AM


All times are GMT -5. The time now is 06:14 AM.

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