LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-29-2005, 12:19 AM   #1
kskkumar
Member
 
Registered: Aug 2005
Posts: 40

Rep: Reputation: 15
compiling many .c files in to one .o file


Hi,

I want to compile more than one source files (.c files) in to a single object file (.o) file. i am using gcc compiler version
 
Old 12-29-2005, 01:45 AM   #2
Cirdan
Member
 
Registered: Nov 2005
Distribution: Arch Linux
Posts: 84

Rep: Reputation: 15
To do that you will need make a "Makefile" which is basicaly instructions to tell the computer how to compile a program.

Here are a few tutorials...
http://vertigo.hsrl.rutgers.edu/ug/make_help.html
http://www.opussoftware.com/tutorial/TutMakefile.htm
http://www.gnu.org/software/make/

also...
www.google.com/linux
 
Old 12-29-2005, 08:51 AM   #3
biosx
Member
 
Registered: Jul 2002
Location: Chicagoland
Distribution: Gentoo, Ubuntu
Posts: 63

Rep: Reputation: 15
You don't necessarily need a make-file. You can just tell gcc to use multiple source files like so:

gcc -o out.obj file1.c file2.c file3.c
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling c++ files :( gizmo_thunder Programming 6 10-23-2007 12:57 PM
Help with compiling java files.... amer_58 Linux - Newbie 1 10-25-2005 04:17 PM
Compiling driver files AngryDwarf Linux - Hardware 1 09-28-2005 07:05 AM
Compiling C++ Header Files ?? JinBaba Programming 3 07-20-2005 03:23 AM
Compiling files bacloff Linux - Software 3 08-27-2003 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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