LinuxQuestions.org
Help answer threads with 0 replies.
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-11-2006, 12:34 PM   #1
naobi
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
Cool compiling &running C program


I've just installed fedora core 3 , actually I'm a firsttime user of linux. I have learnt c programming in windows xp, I wanted it to do in linux. So once I've written a c program in gedit and then I clicked action which in the desktop and then I choosed run and I wrote there gcc and the name as I've saved. But I saw no changes and again there I wrote gcc-o hello with its name and nothing happens.

So please tell me step by step how to write a c program and compile it and then run it.
 
Old 09-11-2006, 12:40 PM   #2
naobi
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Original Poster
Rep: Reputation: 0
please help step by step how to write a c program and compile it and then run it. I've already learnt c programming in windows(turbo c) platform. I wanted it to do in fefora core 3.
 
Old 09-11-2006, 12:42 PM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
What do you mean by "nothing happens"?? We need more details. You're meant to open a terminal window and run gcc there. Let's assume for a moment your source file is called hello.c. Running "gcc hello.c" (without quotes, obviously) will create an executable called a.out, which you can run with "./a.out" (without quotes again). If you use "gcc -ohello hello.c", then the executable will be called hello, which you can run with "./hello". That's pretty much all there is to it. You can add extra gcc options to show warnings and other things (see the gcc man page), but those aren't important for the time being.

Edit: please be patient :/.
 
  


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
help compiling a program minm Linux - Newbie 3 10-10-2005 01:14 AM
running a program in background of X using & Dachy Linux - General 1 09-13-2005 11:38 AM
compiling & running java using gcc kiran_kondru17 Linux - Newbie 1 01-04-2005 11:49 AM
Compiling Program Star3132 Linux - General 8 06-29-2004 05:35 AM
Running a program after compiling - How? halem Linux - Newbie 2 02-24-2001 10:11 AM

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

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