configure: error: png library not found

Report bugs, bug fixes and workarounds here.
Topic author
neoslak

configure: error: png library not found

Post #1by neoslak » 14.01.2003, 13:45

Hi y'all -

For some weird reason I'm having a little trouble compiling Celestia 1.2.5 on my Slackware 9b Linux system. I have GCC 3.2.1. It's an AMD Athlon 650 with a NVidia GeForce2 MX DDR.

I used "./configure --prefix=/usr --with-kde" and I get:
...
...
checking for png_create_info_struct in -lpng... no
configure: error: png library not found

I've got libpng-1.2.5 installed and working with everything else.

The config.log shows:

----<clip>-----
...
...
configure:29411: checking for png_create_info_struct in -lpng
configure:29444: gcc -z combreloc -o conftest -ansi -W -Wall -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DNDEBUG -O2 -I/usr/X11R6/include -O2 -Wall -ffast-math -fexpensive-optimizations -fomit-frame-pointer -DQT_THREAD_SUPPORT -D_REENTRANT -z combreloc conftest.c -lpng -ljpeg -lglut -lGLU -lGL -lSM -lICE -lm -L/usr/X11R6/lib -lXmu -lXi -lXext -lX11 -lm >&5
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `deflate'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `inflate'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `inflateInit_'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `crc32'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `deflateInit2_'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `inflateReset'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `deflateReset'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `inflateEnd'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `deflateEnd'
collect2: ld returned 1 exit status
configure:29447: $? = 1
configure: failed program was:
#line 29418 "configure"

----<clip>-----

When I ls -l /usr/lib/libpng* I see

-rw-r--r-- 1 root root 196822 Oct 13 19:17 /usr/lib/libpng12.a
lrwxrwxrwx 1 root root 13 Dec 14 10:10 /usr/lib/libpng12.so -> libpng12.so.0
lrwxrwxrwx 1 root root 19 Dec 14 10:10 /usr/lib/libpng12.so.0 -> libpng12.so.0.1.2.5
-rwxr-xr-x 1 root root 188567 Oct 13 19:17 /usr/lib/libpng12.so.0.1.2.5
lrwxrwxrwx 1 root root 10 Dec 14 10:10 /usr/lib/libpng.a -> libpng12.a
lrwxrwxrwx 1 root root 11 Dec 14 10:10 /usr/lib/libpng.so -> libpng.so.3
lrwxrwxrwx 1 root root 18 Dec 14 10:02 /usr/lib/libpng.so.2 -> libpng.so.2.1.0.12
-rwxr-xr-x 1 root root 168880 Jun 2 2002 /usr/lib/libpng.so.2.1.0.12
lrwxrwxrwx 1 root root 17 Dec 14 10:10 /usr/lib/libpng.so.3 -> libpng.so.3.1.2.5
-rwxr-xr-x 1 root root 173400 Jun 2 2002 /usr/lib/libpng.so.3.1.2.1
-rwxr-xr-x 1 root root 188567 Oct 13 19:17 /usr/lib/libpng.so.3.1.2.5


What could be wrong?

Thanks

Chuck

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

configure: error: png library not found

Post #2by t00fri » 14.01.2003, 13:55

neoslak wrote:Hi y'all -

For some weird reason I'm having a little trouble compiling Celestia 1.2.5 on my Slackware 9b Linux system. I have GCC 3.2.1. It's an AMD Athlon 650 with a NVidia GeForce2 MX DDR.

I used "./configure --prefix=/usr --with-kde" and I get:
...
...
checking for png_create_info_struct in -lpng... no
configure: error: png library not found

I've got libpng-1.2.5 installed and working with everything else.

The config.log shows:

----<clip>-----
...
...
configure:29411: checking for png_create_info_struct in -lpng
configure:29444: gcc -z combreloc -o conftest -ansi -W -Wall -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DNDEBUG -O2 -I/usr/X11R6/include -O2 -Wall -ffast-math -fexpensive-optimizations -fomit-frame-pointer -DQT_THREAD_SUPPORT -D_REENTRANT -z combreloc conftest.c -lpng -ljpeg -lglut -lGLU -lGL -lSM -lICE -lm -L/usr/X11R6/lib -lXmu -lXi -lXext -lX11 -lm >&5
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `deflate'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `inflate'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `inflateInit_'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `crc32'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `deflateInit2_'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `inflateReset'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `deflateReset'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `inflateEnd'
/usr/lib/gcc-lib/i386-slackware-linux/3.2.1/../../../libpng.so: undefined reference to `deflateEnd'
collect2: ld returned 1 exit status
configure:29447: $? = 1
configure: failed program was:
#line 29418 "configure"

----<clip>-----

When I ls -l /usr/lib/libpng* I see

-rw-r--r-- 1 root root 196822 Oct 13 19:17 /usr/lib/libpng12.a
lrwxrwxrwx 1 root root 13 Dec 14 10:10 /usr/lib/libpng12.so -> libpng12.so.0
lrwxrwxrwx 1 root root 19 Dec 14 10:10 /usr/lib/libpng12.so.0 -> libpng12.so.0.1.2.5
-rwxr-xr-x 1 root root 188567 Oct 13 19:17 /usr/lib/libpng12.so.0.1.2.5
lrwxrwxrwx 1 root root 10 Dec 14 10:10 /usr/lib/libpng.a -> libpng12.a
lrwxrwxrwx 1 root root 11 Dec 14 10:10 /usr/lib/libpng.so -> libpng.so.3
lrwxrwxrwx 1 root root 18 Dec 14 10:02 /usr/lib/libpng.so.2 -> libpng.so.2.1.0.12
-rwxr-xr-x 1 root root 168880 Jun 2 2002 /usr/lib/libpng.so.2.1.0.12
lrwxrwxrwx 1 root root 17 Dec 14 10:10 /usr/lib/libpng.so.3 -> libpng.so.3.1.2.5
-rwxr-xr-x 1 root root 173400 Jun 2 2002 /usr/lib/libpng.so.3.1.2.1
-rwxr-xr-x 1 root root 188567 Oct 13 19:17 /usr/lib/libpng.so.3.1.2.5


What could be wrong?

Thanks

Chuck


Look at the mix of /different/ png libs in your system. To which one do your header files belong?? You are probably using a too old libpng version, because of this "chaos"...

You must always exercise great care with library upgrades. Deinstall all previous /developer/ versions
before installing a new one (that includes header files!). No problem
with older /runtime/ libs.

Bye Fridger

Topic author
neoslak

png library not found

Post #3by neoslak » 16.01.2003, 05:08

Thanks for the reply.

I still don't know how to fix this. I don't even know how this occurred. The only libpng package I thought I had installed was libpng-1.2.5-i386-1 from my Slackware distribution. So I tried uninstalling it and I tried deleting the other libpng* files in /usr/lib and in /usr/include and then reinstalled the libpng-1.2.5-i386-1 package. Now /usr/lib/libpng* shows:

-rw-r--r-- 1 root root 196842 Jan 15 19:50 /usr/lib/libpng12.a
lrwxrwxrwx 1 root root 13 Jan 15 19:52 /usr/lib/libpng12.so -> libpng12.so.0
lrwxrwxrwx 1 root root 19 Jan 15 19:52 /usr/lib/libpng12.so.0 -> libpng12.so.0.1.2.5
-rwxr-xr-x 1 root root 180518 Jan 15 19:50 /usr/lib/libpng12.so.0.1.2.5
lrwxrwxrwx 1 root root 10 Jan 15 19:52 /usr/lib/libpng.a -> libpng12.a
lrwxrwxrwx 1 root root 11 Jan 15 19:52 /usr/lib/libpng.so -> libpng.so.3
lrwxrwxrwx 1 root root 17 Jan 15 19:52 /usr/lib/libpng.so.3 -> libpng.so.3.1.2.5
-rwxr-xr-x 1 root root 180518 Jan 15 19:50 /usr/lib/libpng.so.3.1.2.5

Which looks better but I'm still getting the same error messages when I try to compile Celestia (or, I discovered, other programs such as xawtv that check for libpng). So, this certainly looks like it is not a Celestia problem after all. Sorry for the mis-assumption. :-)
Oh well... I've searched Google, various Slackware sites, even tried to read the libpng man pages and I still don't have a clue where the problem is. Any help appreciated.


Thanks -

Chuck

cheesenoodle

png library not found

Post #4by cheesenoodle » 21.01.2003, 22:06

I had the same problem too. Apparently libpng needs libz to link right, so setting LIBS=-lz before running configure seems to solve the problem.

Bohdan

How to solve prolem

Post #5by Bohdan » 25.01.2003, 17:34

This is done with the chnage of libpng package. From 1.2.5 it the configuration is based on packagin. This means that all parameters for compilation should be obtained from `libpng-config -libs` which returns `-lpng12 -lz -lm` guys from celestia rely only on -lpng. Thus you can downgrade to some older libpng or guys from celestia should repair their autoconf

cheesenoodle

png library not found

Post #6by cheesenoodle » 16.03.2003, 19:36

cheesenoodle wrote:I had the same problem too. Apparently libpng needs libz to link right, so setting LIBS=-lz before running configure seems to solve the problem.


Yes now it works. It should be repaired in next version ...


Return to “Bugs”