www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/03/29/18:15:15.1

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Dong Soo Kim <dsk666 AT cse DOT unsw DOT EDU DOT AU>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: libraries in another folder
Date: Sat, 30 Mar 2002 09:12:40 +1100
Organization: The University of New South Wales
Lines: 31
Message-ID: <Pine.GSO.4.44.0203300908091.24668-100000@hummel.orchestra.cse.unsw.EDU.AU>
References: <20020327022046 DOT 39224 DOT qmail AT web21410 DOT mail DOT yahoo DOT com>
<200203270227 DOT g2R2Rc125988 AT envy DOT delorie DOT com>
NNTP-Posting-Host: hummel.orchestra.cse.unsw.edu.au
Mime-Version: 1.0
X-Trace: tomahawk.unsw.edu.au 1017439859 21511 129.94.242.21 (29 Mar 2002 22:10:59 GMT)
X-Complaints-To: abuse AT unsw DOT edu DOT au
NNTP-Posting-Date: Fri, 29 Mar 2002 22:10:59 +0000 (UTC)
X-X-Sender: dsk666 AT hummel DOT orchestra DOT cse DOT unsw DOT EDU DOT AU
In-Reply-To: <200203270227.g2R2Rc125988@envy.delorie.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 26 Mar 2002, DJ Delorie wrote:

> > How can GCC automatically look for necessary libraries in another
> > folder and its subfolders?
>
> The -L option adds one directory to the search path.  There is no
> single option to add an entire directory tree.
>
> 	gcc *.o -L../foo -lfoo -o my.exe
>
> This only works with libraries specified with "-l" though, which must
> be named (for the example above) "libfoo.a".
>
> The usual convention, though, is to use a Makefile and provide the
> full path to the library through it, so you just type "make" and all
> those really long command lines "just happen" :-)

If you're creating your own libraries and want to store them separately
from the standard ones, then I recommend creating a directory for that
purpose and adding the path to the DJGPP.ENV file.

Under the section [gpp] there is an env variable called LIBRARY_PATH.
Just add your library path to it and from then on the library will be
available for all your projects while still being stored separately from
the djgpp standard libraries.

Similarly with include files.

Good luck
DSK

- Raw text -


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