Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-18-2003, 07:50 PM   #1
Registered: Jun 2003
Distribution: Debian
Posts: 110

Rep: Reputation: 15
Compiling C in Linux

I have some old code I did in standard ANSI C that runs a little command line program. I want to port this to Linux, but am a complete newbie as to how to use the tools available for software development.

I have two files, a header.h file and a source.c file.
How does one go about doing a no-frills compiling of this?
Old 09-18-2003, 08:47 PM   #2
Registered: Apr 2003
Distribution: Debian Sarge
Posts: 259

Rep: Reputation: 30
If you just want to give compiling it a shot, run

$ gcc -o source source.c

The "-o source" means that the output executable binary will be named "source". If it compiles you can then run it with

$ ./source

The "./" before "source" tells your shell that the program is in the current directory so it doesn't go searching the PATH looking for it.


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++ in linux deapee Programming 14 08-07-2012 11:05 AM
Compiling a program for X-Linux 4.1 steaktc Programming 7 11-01-2005 07:36 AM
compiling linux kernel-2.6.11 kskkumar Linux - Newbie 2 08-22-2005 12:00 PM
compiling .exe in linux bluefusionx Linux - Software 17 12-06-2004 12:19 AM
Compiling C++ in Linux TexasDex Linux - Software 14 04-03-2003 03:48 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:12 PM.

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