Mail Archives: djgpp/1997/02/28/11:36:59
Sam. (sam AT greenaum DOT demon DOT co DOT uk) wrote:
: How do I do libraries in DJGPP? I managed to get GCC to compile some C
: into an .O file, but that's as far as I got. I read some of the dox
: for ld, but to be honest I don't even know that's what I should be
: using. Basically I don't have a clue, somebody please explain how to
: get from C source -> .h file and a library to link.
If you want to make a library, you should already have the .h file,
which you then #include in your source file(s). The .h file is the place
to put your funtion prototypes, variable and structure definitions, and
so on. Then, after compiling your library sources to object file(s), you
use ar (see docs for binutils) to compress the .o file(s) to a single
file called libMYLIB.a (MYLIB stands for the name of your library). To
link it into your program, add -lMYLIB at the end of your
compiling/linking command.
--
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/
- Raw text -