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

a 夏天 提交于 2020-01-01 12:31:08

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/11070473/how-can-i-use-jpeg-mem-src-jpeg-mem-dest-in-libjpeg-turbo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!