I'm just reporting. I faced an issue while tried to build libpng on Amazon Linux (Red Hat based). But I got following error:
libtool: link: gcc -g -O2 -o .libs/pngfix contrib/tools/pngfix.o ./.libs/libpng16.so -lz -lm ./.libs/libpng16.so: undefined reference to `inflateValidate' collect2: error: ld returned 1 exit status
I checked environment variables and they were set normally.
nm tool displayed that
inflateValidate was in zlib library exports. I hope my solution (see below) will help somebody and will save his time.
The solution was to add
./configure --prefix=/usr LDFLAGS="-L/usr/lib -lz"
This solved the issue.
Running, on Lubuntu 16-04 on a 64 bits box, my solution was to specify the path to the
First, build the
./configure \ --prefix=/home/stephane/programs/install make make install make clean
Then, build the
libpng library by specifying the dependency with the
./configure \ --prefix=/home/stephane/programs/install \ --with-zlib-prefix=/home/stephane/programs/install make make install make clean