Ask Your Question

Revision history [back]

OpenCV 3.4.3: libjpeg-turbo does not export jpeg_mem_src() or jpeg_mem_dest()

According to libjpeg-turbo, I think jpeg_mem_src() and jpeg_mem_dest() should be exported:

From 'https://libjpeg-turbo.org/Documentation/OfficialBinaries': "libjpeg-turbo 1.3 beta and later add support for the in-memory source/destination managers (jpeg_mem_src() and jpeg_mem_dest()), which were previously only available when emulating the libjpeg v8 API/ABI."

I see that OpenCV 3.4.3 includes libjpeg-turbo 1.5.3. So, I was expecting those symbols (I have set '-DOPENCV_SKIP_VISIBILITY_HIDDEN=ON').

However, they are missing. When I try to link a downstream project with openCV and use jpeg_mem_src() and jpeg_mem_dest(), I'm getting this error:

unresolved external symbol _jpeg_mem_src referenced in function

I've also tried passing '-DWITH_JPEG8=1' to cmake, but that had no effect.

The only thing that worked for me was setting '-DBUILD_JPEG_TURBO_DISABLE=ON' and falling back to the regular libjpeg.

I'm wondering if the source code checked into opencv under /3rdparty/libjpeg-turbo is missing something, or maybe the libjpeg-turbo/CmakeList.txt is missing something?