Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 06-24-2005, 03:41 AM   #1
Registered: Jun 2005
Distribution: Fedora 11
Posts: 68

Rep: Reputation: 15
How to program C in Linux command line

How to edit source code(I can use editor vi?).How to compile,link and excute it?Where can I find
the tutorial about that?Thanks.
Old 06-24-2005, 03:52 AM   #2
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
You can use vi or any other editor of your choice. To compile and link you use gcc:
gcc -o progname file1.c file2.c ....

And to run it, ./progname
Old 06-24-2005, 05:58 AM   #3
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Moved: More suitable in Programming.
Old 06-24-2005, 05:59 PM   #4
LQ Newbie
Registered: Jan 2005
Location: UK
Distribution: Debian
Posts: 11

Rep: Reputation: 0
If you end up using more than one source file (as you should if you're writing anything but the smallest of programs) you should learn about makefiles. Googling "makefile tutorial" should give you loads of links.
Old 06-24-2005, 06:57 PM   #5
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 31
Learn vi, make, and what arguments you need to pass to gcc to compile and link your code the way you want.

Also read up on the LinuxQuestions wiki.


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
need a command line email program paperdiesel Linux - Software 10 09-05-2006 06:32 AM
How To Run Program From Command Line? neuropulse Linux - Newbie 2 04-16-2005 05:46 PM
How to register a program for command line?? wepakis Linux - Software 8 11-13-2004 02:07 AM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 08:19 AM
C program code to run a Linux command line Linh Programming 10 06-11-2003 01:59 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:23 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration