Package: libpng++-dev
Version: 0.2.5-1

When trying to compile https://github.com/Malvineous/libgamegraphics I got an 
error during configure:

checking if png++ is new enough... configure: error: png++ is too old.
Please download and install png++ newer than 0.2.5.

However when I checked I did have png++ 0.2.5 or newer:

host$ dpkg -l libpng++-dev | tail -1
ii  libpng++-dev                0.2.5-1            all                C++ 
interface to the PNG (Portable Network Graphics) library

So I went about digging through config.log and found that the program configure 
was compiling to determine if the installed png++ was>= 0.2.5 caused ae error.
I distilled the program further and arrived at this:

host$ cat bug.cpp
#include <png++/png.hpp>
int main ()
{
    std::string fn;
    png::image<png::index_pixel> png(fn);
    return 0;
}

When I try to compile this I get an error message:

host$ g++ -o bug -I/usr/include/libpng12 bug.cpp -lpng
In file included from /usr/include/png++/png.hpp:55:0,
                 from bug.cpp:1:
/usr/include/png++/consumer.hpp: In instantiation of ‘void png::consumer<pixel, 
pixcon, info_holder, interlacing_supported>::read(istream&, const 
transformation&) [with istream = std::basic_ifstream<char>; transformation = 
png::convert_color_space<png::index_pixel>; pixel
/usr/include/png++/image.hpp:240:13:   required from ‘void 
png::image<pixel>::read_stream(istream&, const transformation&) [with istream = 
std::basic_ifstream<char>; transformation = 
png::convert_color_space<png::index_pixel>; pixel = png::index_pixel]’
/usr/include/png++/image.hpp:200:42:   required from ‘void 
png::image<pixel>::read(const char*, const transformation&) [with 
transformation = png::convert_color_space<png::index_pixel>; pixel = 
png::index_pixel]’
/usr/include/png++/image.hpp:175:45:   required from ‘void 
png::image<pixel>::read(const string&, const transformation&) [with 
transformation = png::convert_color_space<png::index_pixel>; pixel = 
png::index_pixel; std::string = std::basic_string<char>]’
/usr/include/png++/image.hpp:107:47:   required from 
‘png::image<pixel>::image(const string&) [with pixel = png::index_pixel; 
std::string = std::basic_string<char>]’
bug.cpp:5:40:   required from here
/usr/include/png++/consumer.hpp:162:25: error: no match for call to ‘(const 
png::convert_color_space<png::index_pixel>) 
(png::reader<std::basic_ifstream<char>>&)’
             transform(rd);
                         ^

At this point I started browsing the patches applied to png++ after 0.2.5 was
released to see if there was anything that could solve my problem. After some
digging I found that r120 indeed contained a patch that resolved the error:

http://svn.savannah.nongnu.org/viewvc?view=rev&root=pngpp&revision=120
http://svn.savannah.nongnu.org/viewvc/trunk/convert_color_space.hpp?root=pngpp&r1=109&r2=120&pathrev=120

I applied these changes and afterwards I could compile the program without 
errors:

host$ g++ -o bug -I/usr/include/libpng12 bug.cpp -lpng
host$ echo $?
0

Running the program still fails, but configure never actually links the program,
so this is expected:
host$ ./bug
terminate called after throwing an instance of 'png::std_error'
  what():  : No such file or directory
Aborted

For your reference I'm using this version of g++:
host$ dpkg -l g++ | tail -1
ii  g++                         4:4.8.1-3          amd64              GNU C++ 
compiler

I would appreciate if at least the patch in r120 was applied in Debians repo
and released as 0.2.5-2 or similar. This would mean that I would no longer
encounter an error. Thanks! :)

 / Sebastian                                      

--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to