Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


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

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


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
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...

Old 12-29-2005, 08:51 AM   #3
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


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 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

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