bitbank2 / JPEGDEC

An optimized JPEG decoder for Arduino
Apache License 2.0
365 stars 47 forks source link

Example's wont compile #71

Closed Jasperbauerbrown closed 3 months ago

Jasperbauerbrown commented 3 months ago

I'm trying to use this in the Arduino IDE 2.3.2, but nothing will compile with this library included, even the examples. Error:

In file included from C:\Users\jaspe\Documents\Arduino\libraries\JPEGDEC\src\JPEGDEC.cpp:33:
C:\Users\jaspe\Documents\Arduino\libraries\JPEGDEC\src\jpeg.inl: In function 'void JPEGIDCT(JPEGIMAGE*, int, int)':
C:\Users\jaspe\Documents\Arduino\libraries\JPEGDEC\src\jpeg.inl:1926:19: error: unused variable 'ucColMask' [-Werror=unused-variable]
     unsigned char ucColMask;
                   ^~~~~~~~~
C:\Users\jaspe\Documents\Arduino\libraries\JPEGDEC\src\JPEGDEC.cpp: At global scope:
C:\Users\jaspe\Documents\Arduino\libraries\JPEGDEC\src\JPEGDEC.cpp:30:18: error: 'void JPEG_setFramebuffer(JPEGIMAGE*, void*)' declared 'static' but never defined [-Werror=unused-function]
 JPEG_STATIC void JPEG_setFramebuffer(JPEGIMAGE *pPage, void *pFramebuffer);
                  ^~~~~~~~~~~~~~~~~~~
C:\Users\jaspe\Documents\Arduino\libraries\JPEGDEC\src\JPEGDEC.cpp:30:18: warning: 'void JPEG_setFramebuffer(JPEGIMAGE*, void*)' used but never defined
cc1plus.exe: some warnings being treated as errors

exit status 1

Compilation error: exit status 1
bitbank2 commented 3 months ago

What target processor? Most don't turn warnings into errors. You can also change the compiler flags to not do that.

Jasperbauerbrown commented 3 months ago

Thanks for the quick response, it seems I didn't have the IDE set to ignore that. Everything works now, thanks!

Jasperbauerbrown commented 3 months ago

Setting compiler flags fixed the issue