Date: Sun, 14 Jul 2002 00:19:58 +0300 From: Giorgos Keramidas <keramida@FreeBSD.ORG> To: Paul Everlund <tdv94ped@cs.umu.se> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Include files in /usr/local/include not found Message-ID: <20020713211958.GD26124@hades.hell.gr> In-Reply-To: <3D3013EA.C0904498@cs.umu.se> References: <3D3013EA.C0904498@cs.umu.se>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2002-07-13 13:50 +0000, Paul Everlund wrote:
> I got an error while making ./configure for a program. It said it
> did not find png.h, but it's there as I have png-1.2.4 installed
> on my system.
But in /usr/local/include which is not searched by default for headers
by GCC in FreeBSD.  You need to explicitly pass -I/usr/local/include
to the compiler command line.
> Got the following error:
> test.c:1: png.h: No such file or directory
>
> Did then try to compile it as this:
> cc -I/usr/local/include test.c
>
> This worked!
Obviously :)
> My question is:
> How do one fix so /usr/local/include is searched automatically?
The autoconf-generated scripts that are distributed as ./configure in
many open source programs will detect CFLAGS in the environment and
use it for ``default compiler flags''.  I am not sure if they will
automagically look in ${prefix}/include for headers (in which case
passing -I/usr/local/include would not be necessary when one runs
./configure with --prefix=/usr/local).  You can always force
./configure to pass -I/usr/local/include to all invocations of GCC
when testing though by setting CFLAGS to your environment:
	% setenv CFLAGS " -I/usr/local/include -L/usr/local/lib "
	% ./configure --prefix=/wherever
> If that can be done, the ./configure should work for the program
> I'm trying to build.
Hopefully :)
It should.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020713211958.GD26124>
