Mail Archives: djgpp/1996/07/10/22:01:48
Reply to message 6668799 from LOLO AT EINEV0 DOT E on 07/10/96 4:15AM
>But when I give a "gcc myprog.c .../grx20/lib/libgrx20.a" it's compile fine
>and my .EXE is working.
This is actually not the correct way to link the library - you should use the
-l compiler option, i.e.
gcc -Wall -g -O -o myprog.exe myprog.c -lgrx20
The stuff at the beginning is useful to add, too (look in the gcc docs for
explanations). :)
>The questions : Why must I give the path and name of the library to use it.
>And if it's right so, what is the role of the path to the grx library in my
>DJGPP.ENV
The path tells gcc where to look *for* libraries that you instruct it to link
with the -l switch. It doesn't instruct the linker to look *in* all those
libraries,
though - that would seriously slow it down. The only files linked in
automatically are libc.a, libgcc.a, and crt0.o - you yourself must specify
any others that you need. (Exception: 'gxx' automatically links the C++
libraries when run, but it is in effect just a fancy wrapper for 'gcc'.)
John
- Raw text -