delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/03/26/21:29:52

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Tue, 26 Mar 2002 21:27:38 -0500
Message-Id: <200203270227.g2R2Rc125988@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: quitestars AT yahoo DOT com
CC: djgpp AT delorie DOT com
In-reply-to: <20020327022046.39224.qmail@web21410.mail.yahoo.com> (message
from Tina on Tue, 26 Mar 2002 18:20:46 -0800 (PST))
Subject: Re: libraries in another folder
References: <20020327022046 DOT 39224 DOT qmail AT web21410 DOT mail DOT yahoo DOT com>
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

> 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" :-)

- Raw text -


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