Mail Archives: djgpp/1997/08/17/13:07:55
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 -