[blfs-support] PNGNQ Build Fails

Pierre Labastie pierre.labastie at neuf.fr
Sat Dec 28 01:04:19 PST 2013


Le 27/12/2013 22:16, Dan McGhee a écrit :
> I know this is not specifically a BLFS package, but I'm trying to build 
> it as an adjunct and helper to GIMP.
> 
> The build fails with:
> 
>> rwpng.c:310:40: error: 'Z_BEST_COMPRESSION' undeclared (first use in 
>> this function)
>>      png_set_compression_level(png_ptr, Z_BEST_COMPRESSION);
>>                                         ^
>> make[2]: *** [rwpng.o] Error 1
> 
> because
> 
>> rwpng.c: In function 'rwpng_version_info':
>> rwpng.c:52:7: error: 'ZLIB_VERSION' undeclared (first use in this 
>> function)
>>        ZLIB_VERSION, zlib_version);
>>        ^
>> rwpng.c:52:7: note: each undeclared identifier is reported only once 
>> for each function it appears in
>> rwpng.c:52:21: error: 'zlib_version' undeclared (first use in this 
>> function)
>>        ZLIB_VERSION, zlib_version);
>>                      ^
> 
> The "config.log" which the executable "config.status" calls in an <exec> 
> command has:
> 
>> 364    Configured with: /usr/src/gcc-4.8.1/gcc-4.8.1/configure 
>> --prefix=/usr --libexecdir=/usr/lib --enable-shared 
>> --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu 
>> --enable-languages=c,c++ --disable-multilib --disable-bootstrap 
>> --disable-install-libiberty --with-system-zlib=
I think this line describes the "gcc" configuration options (when you built
gcc). It has nothing to do with the switch you passed to configure for this
package.
> 
> I used only "--prefix=/usr --libdir=/usr/lib --includedir=/usr/include" 
> and neither libdir nor includedir got passed.  I used those hoping to 
> help the configure script to find zlib.
> 
> The "config.log" has the following lines containing "zlib."
> 
>> configure:5218: checking for library containing zlibVersion
>> /usr/src/pngnq-1.1/pngnq-1.1/conftest.c:43: undefined reference to 
>> `zlibVersion'
>> | char zlibVersion ();
>> | return zlibVersion ();
>> ac_cv_search_zlibVersion=-lz
Well, configure should bomb out when meeting an undefined reference to some
zlib object, unless there is a bundled zlib library.
> 
> Looking at line 364 above, the "/usr/src/gcc-4.8.1/gcc-4.8.1/configure" 
> and the fact that the configure script recognized only the 
> "--prefix=/usr" switch got my attention.  Is this a situation in which 
> autoconf or autoreconf would work?  If so, I don't now how to use those 
> without following instructions in the book and would need help.
Again, this line is just for gcc, so do not worry.
> 
> Another possibility would be for me to edit the line 
> "ac_cv_search_zlibVersion=-lz" but I would not know what to put in place 
> of -lz.
First try to figure out why configure does not find zlib...
> 
> The "/usr/src/gcc-4.8.1" sequence made me suspect that my Package Users 
> system was getting in the way.  I tried to build pngnq as me and got 
> exactly the same results in all areas.
> 
> I'd appreciate some pointers.

Look at configure around line 5218, and try to see what configure is doing to
find zlib (not always easy, because configure scripts are hard to read, but
you may find a small program text that you may try to compile, and see what
comes out). Also, try to see what the logic is, which leads to setting -lz,
while zlib is not found

Try building as root.

Read the beginning of rwpng.c, trying to see why zlib.h is not included. Yyou
might see something like:
----------
#ifdef SOME_SYMBOL
#include <zlib.h>
------------
then try to find where SOME_SYMBOL is defined.

Regards
Pierre





More information about the blfs-support mailing list