Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in png.cpp #15

Open
5cript opened this issue Sep 30, 2018 · 4 comments
Open

Error in png.cpp #15

5cript opened this issue Sep 30, 2018 · 4 comments

Comments

@5cript
Copy link

5cript commented Sep 30, 2018

Error in following example
https://github.com/qPCR4vir/nana-demo/blob/master/Examples/png.cpp#L14
should be:
#elif defined(NANA_ENABLE_JPEG)

@qPCR4vir
Copy link
Owner

qPCR4vir commented Oct 1, 2018

Thank!
Fixed, https://github.com/qPCR4vir/nana-demo/commits/cmake-dev and https://github.com/qPCR4vir/nana/commits/cmake-dev

but now I have tested jpeg... and have problems: a definition duplication of boolean in window.h vs jpeg @cnjinhao ??


In file included from C:/MinGW/include/jpeglib.h:31,
                 from C:\Prog\ExtLib\nana\source\paint\detail/image_jpeg.hpp:10,
                 from C:\Prog\ExtLib\nana\source\paint\image.cpp:28:
				 
C:/MinGW/include/jmorecfg.h:242:13: 

error: conflicting declaration 'typedef int boolean'
 typedef int boolean;
             ^~~~~~~

			 
			 
			 In file included from c:\mingw\x86_64-w64-mingw32\include\wtypes.h:8,
                 from c:\mingw\x86_64-w64-mingw32\include\winscard.h:10,
                 from c:\mingw\x86_64-w64-mingw32\include\windows.h:97,
                 from c:\prog\extlib\nana\source\detail\mswin/platform_spec.hpp:24,
                 from c:\prog\extlib\nana\source\detail\platform_spec_selector.hpp:18,
                 from C:\Prog\ExtLib\nana\source\paint\image.cpp:16:
				 
c:\mingw\x86_64-w64-mingw32\include\rpcndr.h:65:25: 

note: previous declaration as 'typedef unsigned char boolean'
   typedef unsigned char boolean;
                         ^~~~~~~

@cnjinhao
Copy link
Collaborator

cnjinhao commented Oct 2, 2018

I just checked the jconfig.h coming with the nuwen's mingw distro, it is different with libjpeg-turbo and libjpeg. The libjpeg-turbo and libjpeg define boolean if __RPCNDR_H__ is not defined, so they work well with windows.h.
The libjpeg in nuwen's mingw doesn't check if the boolean has been defined by standard headers. To solve the problem, base on comment at jmorecfg.h:235, adding -DHAVE_BOOLEAN seems to work fine.

@qPCR4vir
Copy link
Owner

qPCR4vir commented Oct 2, 2018

hi!,
yes, I tested that and compile, but i got a run-time error about the user expecting 600 b but jpeg expecting 633 b ??? because now boolean is char and not int ??

@cnjinhao
Copy link
Collaborator

cnjinhao commented Oct 2, 2018

The boolean in nuwen's libjpeg is int, but Windows.h, libjpeg and libjpeg-turbo provide boolean as unsigned char.
I think the best solution is to let people avoid using the nuwen's libjpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants