Opened 13 years ago

Closed 13 years ago

#4033 closed defect (fixed)

Cannot compile with libpng 1.5.4 (zlib.h missing in MS5 branch)

Reported by: mko Owned by: tbonfort
Priority: normal Milestone:
Component: MapServer C Library Version: 5.6
Severity: normal Keywords:
Cc: mko

Description

The libpng 1.5.4 header file png.h does not link to zlib.h any more. MapServer can not be compiled --with-experimental-png.

Solution: add zlib.h to maprgbapng.c

Error message:

maprgbapng.c: In function ‘ms_png_write_image_init’:
maprgbapng.c:146: error: ‘Z_BEST_COMPRESSION’ undeclared (first use in this function)
maprgbapng.c:146: error: (Each undeclared identifier is reported only once
maprgbapng.c:146: error: for each function it appears in.)

Adding --with-png=... as suggested at http://osgeo-org.1803224.n2.nabble.com/Z-BEST-COMPRESSION-undeclared-Error-on-MapServer-5-6-5-make-td5932504.html did not work, because png headers to not define Z_BEST_COMPRESSION and do not include zlib.h any more.

Change History (2)

comment:1 by tbonfort, 13 years ago

Owner: changed from sdlime to tbonfort
Status: newassigned

comment:2 by tbonfort, 13 years ago

Resolution: fixed
Status: assignedclosed

libpng 1.5 was not released when mapserver 5.6 came out. Mapserver 6.0 does not use the zlib.h constants so it is not applicable for newer versions.

I was tempted to close this as wontfix, but decided to #define Z_BEST_COMPRESSION if it wasn't already defined rather than include zlib.h, to minimize the changes in the stable 5.6 branch.

fixed in r12586

Note: See TracTickets for help on using tickets.