delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/17/13:07:55

Date: Sun, 17 Aug 1997 20:01:06 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Vlatko Surlan <vsurlan AT jagor DOT srce DOT hr>
cc: djgpp AT delorie DOT com
Subject: Re: Changes the size of exe or not?
In-Reply-To: <5t539o$2ra@bagan.srce.hr>
Message-ID: <Pine.SUN.3.91.970817200042.14271h-100000@is>
MIME-Version: 1.0

On 16 Aug 1997, Vlatko Surlan wrote:

> Is there any way to solve this or I have to wrrite new
> file with only the functions I need every time I do new stuff??
> Did somebody wrotte something that could on the base of 
> used functions in a programme ( which ain't standard )
> writte a new file containing only functions that I need
> and of course new .h file for it or I have to do it.

Yes, such a way exists.  It is called ``object file libraries''.  You
put every function on its separate source file and compile it.  You
then put all these .o object files into a library using the `ar'
archive utility which comes with DJGPP:

		ar rvs mylib.a *.o

You then submit the name of that library when you link your programs.
For example:

		gcc -o myprog.exe f1.c f2.c mylib.a

The linker will only link in the functions that your program calls.

- Raw text -


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