how can i use jpeg_mem_src, jpeg_mem_dest in libjpeg-turbo?

hello picture hello · Jun 17, 2012 · Viewed 7.5k times · Source

libjpeg8 include are those two functions, but in libjpeg-turbo has the following:

 //jconfig.h
 #define JPEG_LIB_VERSION 62

...

//jpeglib.h
#if JPEG_LIB_VERSION >= 80
/* Data source and destination managers: memory buffers. */
EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
                   unsigned char ** outbuffer,
                   unsigned long * outsize));
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
                  unsigned char * inbuffer,
                  unsigned long insize));
#endif

if i try to use "JPEG_LIB_VERSION 80" i'll get the following:

error LNK2019: unresolved external symbol _jpeg_mem_src referenced in function ...

so, how can i use those functions if it possible? do i need compile some package of libjpeg-turbo?

Answer

Baffe Boyois picture Baffe Boyois · Jun 17, 2012

The precompiled .lib and .dll files only support the version 6 functions. You need to compile your own library. Pass the -DWITH_JPEG8=1 flag to CMake to get those two functions.