www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/07/20:30:15

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: compile 24 C files AND 3 HEADERS
Date: 8 Jan 2002 01:28:57 GMT
Organization: Cornell University
Lines: 32
Sender: asu1 AT cornell DOT invalid (on pool-141-149-208-99.syr.east.verizon.net)
Message-ID: <Xns918FD007E5EB1ASINANUNUR@132.236.56.8>
References: <20020107224807 DOT 85697 DOT qmail AT web12208 DOT mail DOT yahoo DOT com>
NNTP-Posting-Host: pool-141-149-208-99.syr.east.verizon.net
X-Trace: news01.cit.cornell.edu 1010453337 16045 141.149.208.99 (8 Jan 2002 01:28:57 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 8 Jan 2002 01:28:57 GMT
User-Agent: Xnews/4.06.22
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Geethanandh kandasamy <geethanandh AT yahoo DOT com> wrote in 
news:20020107224807 DOT 85697 DOT qmail AT web12208 DOT mail DOT yahoo DOT com:

> Hello
>   I had a software which has 24 .c files and 3 .h
> files in that.Now i want to compile and link all of
> them and i want to provide a single .exe file.I had
> created the object file for all the 24 c files using 
>    gcc -c filename.c 
> Now i would ike to link all the .o files and .h
> files.Pls help me to how to link all those and make a
> exe file.

1. You don't link headers.

2. There are many ways of doing this. If you don't want to write a 
makefile, and would like to avoid typing all the filenames, you can do

dir *.o /b > file.lst
gcc @file.lst -o outname.exe

3. This may not work if there are dependencies across files. If this is the 
case, you can create a library using ar that includes all the *.o files, 
say libfiles.a, and then use the command line

gcc @file.lst libfiles.a -o outname.exe

Sinan
-- 
--------------------------------
A. Sinan Unur
http://www.unur.com/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019