Fedora Linux Support Community & Resources Center
  #1  
Old 25th October 2010, 07:33 AM
DAKSH Offline
Registered User
 
Join Date: Oct 2009
Location: In the Rain
Posts: 134
linuxfedorafirefox
How to run C and C++ in fedora

Hi,
I just want to know how to run c and c++ programming in fedora. I have tried by
Code:
yum install gcc
it showing me I have installed gcc but when I trying to run it by gcc it's not running please help me.
Thank you.
Reply With Quote
  #2  
Old 25th October 2010, 07:46 AM
Firewing1 Offline
Registered User
 
Join Date: Dec 2004
Location: Canada
Age: 23
Posts: 9,224
macossafari
Re: How to run C and C++ in fedora

For c++ you'll need the g++ binary as well:
Code:
yum install gcc gcc-c++
Then you can use gcc (for C) and g++ (for C++) code. What error do you receive when you try and run gcc?
__________________
[+] My open source software and blog
[+] Some of my howtos: (for full list, click here)
Reply With Quote
  #3  
Old 25th October 2010, 08:25 AM
CSchwangler Offline
Registered User
 
Join Date: Feb 2009
Posts: 2,535
linuxfirefox
Re: How to run C and C++ in fedora

You can also install the group "Development Tools", which gives you everything you need to start developing.
Reply With Quote
  #4  
Old 25th October 2010, 11:09 AM
DAKSH Offline
Registered User
 
Join Date: Oct 2009
Location: In the Rain
Posts: 134
linuxfedorafirefox
Re: How to run C and C++ in fedora

I have installed it but when I am typing gcc i am getting this prompt
Code:
[root@localhost /]# gcc
gcc: no input files
Reply With Quote
  #5  
Old 25th October 2010, 11:22 AM
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,994
linuxfedorafirefox
Re: How to run C and C++ in fedora

It's just telling you that you haven't specified a file to compile.

Cut-n-paste this to create t.c
cat > t.c <<EOF
#include <stdio.h>
int main() { printf("Yellow, world.\n"); }
EOF


Then
[stevea@luchs tmp]# gcc -o t t.c
[stevea@luchs tmp]# ./t
Yellow, world.
[stevea@luchs tmp]# gcc --version
gcc (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10)
Copyright (C) 2010 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.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #6  
Old 25th October 2010, 11:47 AM
DAKSH Offline
Registered User
 
Join Date: Oct 2009
Location: In the Rain
Posts: 134
linuxfedorafirefox
Re: How to run C and C++ in fedora

Thanks Buddy for the help
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


Current GMT-time: 01:17 (Friday, 28-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
CAM Photos on Instagram