waqasbhatti / wcs2kml

Automatically exported from code.google.com/p/wcs2kml
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

image.cc doesn't compile because of missing png_set_gray_1_2_4_to_8 #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I get the build error shown below on Mac OS X Lion.
My ligpng was installed via Macports:
  libpng @1.4.8_0+universal (active)

I'd really like to check out this tool, so if you have any advice that would be 
great!

Christoph

Btw., the INSTALL still describes that installation should be done via 
configure, but that has been removed.

$ make
g++ -I/opt/local/include -I/usr/local/include -I./libwcs -Wall -O3 -c base.cc
g++ -I/opt/local/include -I/usr/local/include -I./libwcs -Wall -O3 -c 
string_util.cc
g++ -I/opt/local/include -I/usr/local/include -I./libwcs -Wall -O3 -c color.cc
g++ -I/opt/local/include -I/usr/local/include -I./libwcs -Wall -O3 -c image.cc
image.cc: In member function 'bool google_sky::Image::Read(const std::string&)':
image.cc:456: error: 'png_set_gray_1_2_4_to_8' was not declared in this scope
image.cc: In member function 'bool google_sky::Image::Write(const std::string&) 
const':
image.cc:535: warning: 'width' is deprecated (declared at 
/opt/local/include/png.h:655)
image.cc:535: warning: 'width' is deprecated (declared at 
/opt/local/include/png.h:655)
image.cc:536: warning: 'height' is deprecated (declared at 
/opt/local/include/png.h:656)
image.cc:536: warning: 'height' is deprecated (declared at 
/opt/local/include/png.h:656)
image.cc:537: warning: 'bit_depth' is deprecated (declared at 
/opt/local/include/png.h:667)
image.cc:537: warning: 'bit_depth' is deprecated (declared at 
/opt/local/include/png.h:667)
image.cc:538: warning: 'compression_type' is deprecated (declared at 
/opt/local/include/png.h:672)
image.cc:538: warning: 'compression_type' is deprecated (declared at 
/opt/local/include/png.h:672)
image.cc:539: warning: 'filter_type' is deprecated (declared at 
/opt/local/include/png.h:674)
image.cc:539: warning: 'filter_type' is deprecated (declared at 
/opt/local/include/png.h:674)
image.cc:540: warning: 'interlace_type' is deprecated (declared at 
/opt/local/include/png.h:676)
image.cc:540: warning: 'interlace_type' is deprecated (declared at 
/opt/local/include/png.h:676)
image.cc:541: warning: 'valid' is deprecated (declared at 
/opt/local/include/png.h:657)
image.cc:541: warning: 'valid' is deprecated (declared at 
/opt/local/include/png.h:657)
image.cc:542: warning: 'rowbytes' is deprecated (declared at 
/opt/local/include/png.h:659)
image.cc:542: warning: 'rowbytes' is deprecated (declared at 
/opt/local/include/png.h:659)
image.cc:546: warning: 'color_type' is deprecated (declared at 
/opt/local/include/png.h:669)
image.cc:546: warning: 'color_type' is deprecated (declared at 
/opt/local/include/png.h:669)
image.cc:548: warning: 'color_type' is deprecated (declared at 
/opt/local/include/png.h:669)
image.cc:548: warning: 'color_type' is deprecated (declared at 
/opt/local/include/png.h:669)
image.cc:550: warning: 'color_type' is deprecated (declared at 
/opt/local/include/png.h:669)
image.cc:550: warning: 'color_type' is deprecated (declared at 
/opt/local/include/png.h:669)
image.cc:552: warning: 'color_type' is deprecated (declared at 
/opt/local/include/png.h:669)
image.cc:552: warning: 'color_type' is deprecated (declared at 
/opt/local/include/png.h:669)
make: *** [image.o] Error 1

Original issue reported on code.google.com by Deil.Chr...@googlemail.com on 15 Sep 2011 at 6:46

GoogleCodeExporter commented 9 years ago
got the same error here...
using Snow Leopard and Macports...
anyone can help?

Original comment by herveb...@gmail.com on 11 Mar 2012 at 3:05

GoogleCodeExporter commented 9 years ago
And even with the latest version of libpng it crashes:

/bin/sh ../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. 
-I../../src -I../../src -I../../src/google -I../../src/google/libwcs 
-I/usr/local/src/libpng-1.5.9//include   -I/usr/local/src/libpng-1.5.9//include 
 -g -O2 -I/usr/local/src/libpng-1.5.9//include -Wall -MT pngimage.lo -MD -MP 
-MF .deps/pngimage.Tpo -c -o pngimage.lo pngimage.cc
 g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src -I../../src/google -I../../src/google/libwcs -I/usr/local/src/libpng-1.5.9//include -I/usr/local/src/libpng-1.5.9//include -g -O2 -I/usr/local/src/libpng-1.5.9//include -Wall -MT pngimage.lo -MD -MP -MF .deps/pngimage.Tpo -c pngimage.cc  -fno-common -DPIC -o .libs/pngimage.o
pngimage.cc: In member function 'bool google_sky::PngImage::Read(const 
std::string&)':
pngimage.cc:447: error: 'png_set_gray_1_2_4_to_8' was not declared in this scope
pngimage.cc: In member function 'bool google_sky::PngImage::Write(const 
std::string&) const':
pngimage.cc:544: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:545: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:546: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:547: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:548: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:549: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:550: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:551: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:554: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:556: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:558: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
pngimage.cc:560: error: invalid use of incomplete type 'struct png_info_def'
/usr/local/src/libpng-1.5.9//include/png.h:720: error: forward declaration of 
'struct png_info_def'
make[3]: *** [pngimage.lo] Error 1
make[2]: *** [check-recursive] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1

Original comment by herveb...@gmail.com on 11 Mar 2012 at 3:18

GoogleCodeExporter commented 9 years ago
Solved: 
just install the previous version of libpng (1.2.47) and it works:
http://prdownloads.sourceforge.net/libpng/libpng-1.2.47.tar.gz?download

cheers

Original comment by herveb...@gmail.com on 11 Mar 2012 at 3:37

GoogleCodeExporter commented 9 years ago
as "png_set_gray_1_2_4_to_8 is deprecated", 
you will need to edit the sourcefile to replace with
"png_set_expand_gray_1_2_4_to_8".

Worked for me.
Cheers

Original comment by jean.pau...@gmail.com on 28 Apr 2013 at 10:41