3

I am trying to compile some basic example of loading/writing a .png image using png++ (which is a c++ wrapper for libpng. It is quite important for me to use png++ and not an alternative. As prerequisites png++ needs both libpng which I have successfully built.

the example that i am trying to figure out how to set is located at the following link. http://fedetft.wordpress.com/2010/10/05/handling-png-images-in-cpp/ it ships with a cmakelist and I am using Cmake to build the two examples.

however when I build this I get the following error : "Byte-order could not be detected." which comes from config.hpp

thank you very much

valentin
  • 1,103
  • 2
  • 16
  • 36

1 Answers1

4

I think, libpng++ incorrect defines a WIN32 platform.

You can try to replace #elif defined(__WIN32) to #elif defined(WIN32) in config.hpp file.

P.S. I do not have libpng++ installed right now, so I may be wrong.

P.S.S. And it's only suitable for Windows, ofc.

Sergei Danielian
  • 4,938
  • 4
  • 36
  • 58
  • thank you for your answer ...I did the change and I am now getting some errors from error.hpp (i.e error C2784: 'std::_String_iterator<_Elem,_Traits,_Alloc> std::operator +(_String_iterator<_Elem,_Traits,_Alloc>::difference_type,std::_String_iterator<_Elem,_Traits,_Alloc>)' : could not deduce template argument for 'std::_String_iterator<_Elem,_Traits,_Alloc>' from 'const char [3]' // most of these errors have to do with 'const char[3] ... and from io_base.hpp (i.e. error C3861: 'png_set_gray_1_2_4_to_8': identifier not found) regards – valentin Apr 20 '12 at 17:05
  • i have solved the problem by changing :png_set_gray_1_2_4_to_8 to png_set_expand_gray_1_2_4_to_8 and commenting out the part from error.hhp responsable for the warning. – valentin Apr 20 '12 at 18:35
  • 2
    Hey, I'd appreciate if you filed bug reports for this at the official bug tracker for png++: http://savannah.nongnu.org/bugs/?group=pngpp btw, I'm the author, so feel free to ask more questions in the list or privately ;) – alex Apr 20 '12 at 20:59