www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/25/21:20:41

Xref: news2.mv.net comp.os.msdos.djgpp:7879
From: LEBLANC MARTINE <gj491867 AT er DOT uqam DOT ca>
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: <Pine.HPP.3.91.960825203317.19777A-100000@merlin.si.uqam.ca>
References: <Pine DOT HPP DOT 3 DOT 91 DOT 960824214355 DOT 17077A-100000 AT merlin DOT si DOT uqam DOT ca> <32200864 DOT 5956 AT cs DOT com>
NNTP-Posting-Host: merlin.si.uqam.ca
Mime-Version: 1.0
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019