Mail Archives: djgpp/1997/12/14/21:34:12
Ryan McGee wrote:
> Your actual functions should go into a .c file. To make a library,
> you need to compile your .c code into an .obj and run ar to make a
> .lib(you can find the help for ar in INFO) you then can compile with
> the comand gcc myfile.c -l mylib.lib and it will only include the
> functions you use from your lib.
You have the idea right, but some of the details were incorrect. DJGPP
libraries don't combine to form a library with the extension "LIB".
They combine to form a library of the form "lib[name].a", where [name]
is the name of the library. The Allegro library, for example, is named
"liballeg.a". To tell the linker to link Allegro into a program with a
single C source file named "myfile.c" (assuming all paths are already
and correctly set), use the gcc command:
gcc myfile.c -lalleg
Hopefully I haven't overlooked anything, or this thread will continue to
expand with corrections. -grin-
- Raw text -