LinuxQuestions.org
Help answer threads with 0 replies.
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, 01: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, 02: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, 09: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


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


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


All times are GMT -5. The time now is 07:48 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration