LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-15-2012, 11:14 PM   #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-15-2012, 11:23 PM   #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-15-2012, 11:27 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

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

yum install gcc

should do it
 
Old 07-17-2012, 10: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, 12:17 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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, 03:32 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
.. 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, 12: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, 12:30 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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, 12:30 AM   #9
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
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, 12: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



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

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

All times are GMT -5. The time now is 02:36 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