Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jul 2002 19:16:41 +0200
From:      Paul Everlund <tdv94ped@cs.umu.se>
To:        Roman Neuhauser <neuhauser@bellavista.cz>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Include files in /usr/local/include not found
Message-ID:  <3D306079.FF64E5F9@cs.umu.se>
References:  <3D3013EA.C0904498@cs.umu.se> <20020713140607.GH322@freepuppy.bellavista.cz> <3D303DC6.CD4A5CFB@cs.umu.se> <20020713151247.GI322@freepuppy.bellavista.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks again for your reply!

Roman Neuhauser wrote:
> 
> > Date: Sat, 13 Jul 2002 16:48:38 +0200
> > From: Paul Everlund <tdv94ped@cs.umu.se>
> > To: Roman Neuhauser <neuhauser@bellavista.cz>
> > Cc: freebsd-questions@freebsd.org
> > Subject: Re: Include files in /usr/local/include not found
> >
> > Roman Neuhauser wrote:
> > > > From: Paul Everlund <tdv94ped@cs.umu.se>
> > > >
> > > > 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 <png.h>
> > > >
> > > > 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 <png.h>
> > 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




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