*BSD News Article 92841


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!inferno.mpx.com.au!nsw1.news.telstra.net!wa.news.telstra.net!news.telstra.net!news00.visionet.com.au!chatsusi02.optusvision.com.au!news.aus.world.net!news.us.world.net!news-out.internetmci.com!newsfeed.internetmci.com!news.clubnet.net!news.interworld.net!news.he.net!www.nntp.primenet.com!nntp.primenet.com!news.mathworks.com!rill.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.utell.co.uk!usenet
From: brian@shift.lan.awfulhak.org (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: How are Includes found? (problems with gdbm)
Date: 2 Apr 1997 14:43:45 GMT
Organization: Awfulhak Ltd.
Lines: 35
Message-ID: <5htrb1$l43@ui-gate.utell.co.uk>
References: <333EABE7.15C4@ludd.luth.se>
Reply-To: brian@awfulhak.org, brian@utell.co.uk
NNTP-Posting-Host: shift.utell.net
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.8
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:38495

In article <333EABE7.15C4@ludd.luth.se>,
	Joachim Strömbergson <watchman@ludd.luth.se> writes:
> Tja!
> 
> This might be a very embarrasing question; What path variables are used
> when you compile a program in FreeBD. Let's say that I have a program
> like this:
> 
> [kalle.c]
> #include <stdio.h>
> main() {
>   printf("Kalle rewls\n");
> }
> 
> and I compile this with 'gcc kalle.c'.
> 
> Now, how does the compiler go about to find stdio.h ? Can I control
> where it should look? The specific problem I have is that I have
> installed gdbm with the ports collection. When I try to compile stuff
> that uses gdbm, they can't find it (it is in /usr/local/include).
> 
> Any help greatly appreciated.

You should be able to say something like

make CFLAGS+=-I/usr/local/include

or if you want the /usr/include stuff first,

make CFLAGS+=-idirafter /usr/local/include

-- 
Brian <brian@awfulhak.org> <brian@freebsd.org>
      <http://www.awfulhak.demon.co.uk>
Don't _EVER_ lose your sense of humour !