From owner-freebsd-questions Sat Jul 13 10:16:52 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 9A34237B4C2 for ; Sat, 13 Jul 2002 10:16:46 -0700 (PDT) Received: from tninet.se (lennier.tninet.se [195.100.94.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id 247C143E3B for ; Sat, 13 Jul 2002 10:16:45 -0700 (PDT) (envelope-from tdv94ped@cs.umu.se) Received: from cs.umu.se (h30n1c1o1023.bredband.skanova.com [213.64.164.30]) by lennier.tninet.se (BMR ErlangTM/OTP 3.0) with ESMTP id 483731.580603.1026.1s46553922lennier ; Sat, 13 Jul 2002 19:16:43 +0200 Message-ID: <3D306079.FF64E5F9@cs.umu.se> Date: Sat, 13 Jul 2002 19:16:41 +0200 From: Paul Everlund X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: sv,en MIME-Version: 1.0 To: Roman Neuhauser Cc: freebsd-questions@freebsd.org Subject: Re: Include files in /usr/local/include not found References: <3D3013EA.C0904498@cs.umu.se> <20020713140607.GH322@freepuppy.bellavista.cz> <3D303DC6.CD4A5CFB@cs.umu.se> <20020713151247.GI322@freepuppy.bellavista.cz> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Thanks again for your reply! Roman Neuhauser wrote: > > > Date: Sat, 13 Jul 2002 16:48:38 +0200 > > From: Paul Everlund > > To: Roman Neuhauser > > Cc: freebsd-questions@freebsd.org > > Subject: Re: Include files in /usr/local/include not found > > > > Roman Neuhauser wrote: > > > > From: Paul Everlund > > > > > > > > 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. > > > > > > > > Wrote the following test program: > > > > > > > > ---test.c > > > > #include > > > > > > > > int main() > > > > { > > > > return 0; > > > > } > > > > > > > > Did then compile it with: > > > > cc test.c > > > > > > > > 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! > > > > > > > > My question is: > > > > How do one fix so /usr/local/include is searched automatically? > > > > > > > > If that can be done, the ./configure should work for the program > > > > I'm trying to build. > > > > > I don't have an answer, but two questions instead (and a hint > > > maybe): > > > > > > what does config.log say about that error? > > > > configure:5957: checking for PNG support > > configure:5963: checking for png.h > > configure:5973: cc -E conftest.c >/dev/null 2>conftest.out > > configure:5969: png.h: No such file or directory > > configure: failed program was: > > #line 5968 "configure" > > #include "confdefs.h" > > #include > > configure:5996: checking for png_get_io_ptr in -lpng > > configure:6015: gcc -o conftest -g -O2 conftest.c -lpng 1>&5 > > /usr/libexec/elf/ld: cannot find -lpng > > configure: failed program was: > > #line 6004 "configure" > > #include "confdefs.h" > > /* Override any gcc2 internal prototype to avoid an error. */ > > /* We use char because int might match the return type of a gcc2 > > builtin and then its argument prototype would still apply. */ > > char png_get_io_ptr(); > > > > int main() { > > png_get_io_ptr() > > ; return 0; } > > configure:6037: checking if PNG package is complete > > > > > is the software publically available? > > > > Yep! > > and what is it? :) Top secret! But if you don't tell anyone... :-) XMedcon is the name of the application. > > > morale: don't trust configure, and if at all possible, double > > > check what it tells you with its guts, and config.log > > > > I don't trust configure. :-) That's why I wrote my own test program. > > Directory /usr/include is searched by gcc automatically, but it seems > > /usr/local/include is not. I think that is somehow strange. Locally > > installed packages/libraries with header files should be in gcc's > > search path. > > doesn't that configure have a --enable-png[=/path/to/png/prefix] > option or sumsuch? Nope, not that particular option, but after looking around I found out that writing this worked: env CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure Anyway I think it's strange gcc do not find include files in /usr/local/include by itself, and if it can be done, how is it done? Even though it now turned out to work, I still unfortunately haven't got the answer to that one. :-) Thanks once more for your tips! Best regards, Paul To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message