From owner-freebsd-questions Sat Jul 13 14:20:15 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1C4CE37B406 for ; Sat, 13 Jul 2002 14:20:10 -0700 (PDT) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B50A43E67 for ; Sat, 13 Jul 2002 14:20:08 -0700 (PDT) (envelope-from keramida@FreeBSD.ORG) Received: from hades.hell.gr (patr530-b167.otenet.gr [212.205.244.175]) by mailsrv.otenet.gr (8.12.4/8.12.4) with ESMTP id g6DLK1Hw009808; Sun, 14 Jul 2002 00:20:02 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.5/8.12.5) with ESMTP id g6DLK0ft028004; Sun, 14 Jul 2002 00:20:00 +0300 (EEST) (envelope-from keramida@FreeBSD.ORG) Received: (from charon@localhost) by hades.hell.gr (8.12.5/8.12.5/Submit) id g6DLJxh8028003; Sun, 14 Jul 2002 00:19:59 +0300 (EEST) (envelope-from keramida@FreeBSD.ORG) Date: Sun, 14 Jul 2002 00:19:58 +0300 From: Giorgos Keramidas To: Paul Everlund Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Include files in /usr/local/include not found Message-ID: <20020713211958.GD26124@hades.hell.gr> References: <3D3013EA.C0904498@cs.umu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D3013EA.C0904498@cs.umu.se> X-Operating-System: FreeBSD 5.0-CURRENT i386 X-PGP-Fingerprint: C1EB 0653 DB8B A557 3829 00F9 D60F 941A 3186 03B6 X-Phone: +30-944-116520 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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