Mail Archives: djgpp/1996/08/25/21:20:41
On Sun, 25 Aug 1996, John M. Aldrich wrote:
> This should look like the following:
>
> gcc -O3 -o tacc.exe o/tacc.o o/window.o o/setup.o -lgrx20 -lsv
I've tried every command line positions like I said previously and it
didn't work, anyhow I'll just retry that way ;)
> You MUST put the libraries to link AFTER all other entries on the
> command line. Also, unless libgrx20.a and libsv.a are in the same
> directory as your files, gcc shouldn't be able to find them if
> you specify them that way. Are you seeing 'no such file or directory'
> messages when you compile? If not, then you've put the libraries
> in the wrong place - they should go in the /lib directory of your
> DJGPP distribution.
I know, it's in /djgpp/lib (both files) but it didn't work so I put them
in the current directory instead but withou further success :(
> BTW, the correct way to link libraries is with the -l directive.
> The reason why they need to go last is that ld is a one-pass
> linker. It sees libsv.a first in the command line and knows that
> it is a library, so it searches for unresolved externals. Finding
> none, it then goes and links your .o files, only then finding the
> external references.
I know! That's why I tried every command line position! but anyhow :P
> Please read section 8.9 of the FAQ (v2/faq201b.zip); it gives a
> much fuller treatment of this subject. :)
I'll check that ;) thanks
- Raw text -