Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Mar 2008 11:48:26 -0700 (PDT)
From:      mdh <mdh_lists@yahoo.com>
To:        Eduardo Cerejo <ejcerejo@optonline.net>, FreeBSD-questions@FreeBSD.org
Subject:   Re: How do I add search paths to gcc
Message-ID:  <12987.84776.qm@web56809.mail.re3.yahoo.com>
In-Reply-To: <20080321144325.b13e5236.ejcerejo@optonline.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--- Eduardo Cerejo <ejcerejo@optonline.net> wrote:

> My gcc is only looking in /usr/lib and /usr/include
> for libraries and hearders and I added the paths
> /usr/local/lib/ and /usr/local/include to my .cshrc
> file:
> 
> set path = (/sbin /bin /usr/sbin /usr/bin /usr/games
> /usr/local/sbin /usr/local/bin /usr/local/lib
> /usr/local/include $HOME/bin)

PATH in the environment is where your shell searches
for programs to run from the command line, system(),
etc.  This allows you to type, say, `sh` instead of
having to type out `/bin/sh` or risking having
`/home/somekiddie/sh` run instead when you type it.  

> 
> but I still have to use gcc with -I and -L switch
> for a program to compile or else it will fail.  
> 
> I'm using tcsh.

There are two ways to set up alternate places to find
libraries.  The first is ldconfig, and you can see
ports run this when you install a port containing
shared libraries for example.  The other is to use the
LD_LIBRARY_PATH environment variable to set alternate
paths at run-time.  

The 'ldconfig(1)' man page has more info for you.  

Take care, mdh



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?12987.84776.qm>