Mail Archives: djgpp/1997/01/08/04:13:30
Noah Levenson <noah AT cloud9 DOT net> wrote in article
<5av2qk$apa AT news DOT cloud9 DOT net>...
> I want to comple the source file "ex15.c" to "ex15.exe". I use the
> following command line:
>
> gcc -O -o ex15.exe ex15.c -lliballeg
>
> liballeg.a is a library file in \lib
>
> but it gives me a "-lliballeg: no such file" error! If I do the
> following:
If I am not mistaken you should use:
gcc -O -o ex15.exe ex15.c -lalleg
do not inlcude the lib part with the -l switch unless..................
>
> gcc -O -o ex15.exe ex15.c c:\djgpp\lib\liballeg.a
> it works fine. Why can't I use the -l linking switch?
........you use the whole name of the library which in this case is
liballeg.a,
which makes sense since you are directing the compiler into the actual
library which happens to be liballeg.a;
otherwise use -l switch with the library name stripped of the lib part and
the extension ( .a ) part.
Maan
--
Maan M. Hamze
mmhamze AT mail DOT utexas DOT edu
http://leb.net/~mmhamze
- Raw text -