Xref: news2.mv.net comp.os.msdos.djgpp:7879 From: LEBLANC MARTINE Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with including librairies! Date: Sun, 25 Aug 1996 20:35:50 -0400 Organization: Université du Québec à Montréal Lines: 36 Message-ID: References: <32200864 DOT 5956 AT cs DOT com> NNTP-Posting-Host: merlin.si.uqam.ca Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <32200864.5956@cs.com> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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