Mail Archives: djgpp/1993/08/04/18:57:38
> I compiled some c codes to object files. Then I create a library
> of these objects and put it in the \djgpp\lib directory. However
> when I compile a new c file and try to use the new library without
> giving its path, the gcc compiler complains not able to find the
> library. If I type something like "gcc file.c \djgpp\lib\mylib",
> the program works. Why?
This is how it's supposed to work:
gcc -c myfile.c
ar rv libme.a myfile.o
ranlib libme.a
copy libme.a \djgpp\lib
gcc -v prog.c -lme -o prog
Is this what you're doing?
Gcc sees -lXX and looks for libXX.a in $LIBRARY_PATH.
DJ
- Raw text -