Mail Archives: djgpp/1996/07/19/08:01:12
From: akroev AT sn DOT no (Arne Knut Roev)
Date: 19 Jul 1996 03:21:32 +0200
No, I am not working on a new libc. I am simply writing a number of
more or less useless ;-) functions, and I would like to add them to
a library of my own.
How do I do this, using djgpp ver. 2.0 ?
( And, while we are at it, how do I use the library, once I have
created it ?)
I have tried to find this info in the info-files, and in the FAQs,
but so far I have not been able to locate any relevant info.
BTW: I'm talking C, _not_ C++.
Compile your source to object files (*.o), use 'ar' (included with DJGPP) to
build a library file named something like libMYLIB.a (the "lib" prefix and .a
suffix are required), and run ranlib to build a symbol table in the library.
gcc -c my*.c
ar -r libmylib.a my*.o
ranlib libmylib.a
copy mylib.a \mylibdir
You can then us libmylib like any other DJGPP library:
gcc -o myapp.exe app*.c -L/mylibdir -lmylib
--
Art S. Kagel, kagel AT quasar DOT bloomberg DOT com
A proverb is no proverb to you 'till life has illustrated it. -- John Keats
- Raw text -