Ask Your Question
0

libjpeg linker error with OpenCV 3.0.0 alpha on Win8, VS2012

asked 2014-09-18 03:36:14 -0600

r r gravatar image

updated 2014-09-18 03:45:46 -0600

Hello,

I have a very simple C++ application which reads an input JPEG image and uses some filter operations on it. The input image is read through cv::imread, which requires opencv_imgcodecs300 library. After some unresolved externals, this is the full list of the linker additional dependencies, VS2012:

ippicvmt.lib
libjpegd.lib
libwebpd.lib
zlibd.lib
opencv_imgcodecs300d.lib

(Without 'd' for Release mode).
"Additional library directories" refers to <opencv300 root="">\opencv\build\x86\vc11\staticlib However I still get the following linker error:

error LNK2019: unresolved external symbol _jpeg_default_qtables referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int=""> > const &)" (?write@JpegEncoder@cv@@UAE_NABVMat@2@ABV?$vector@HV?$allocator@H@std@@@std@@@Z)

It looks like _jpeg_default_qtables should belong to libjpeg, which is already linked...

Any other ideas?

Thanks!

edit retag flag offensive close merge delete

Comments

1

try changing the order of the libs. opencv_imgcodecs should go before its dependancies.

when doing dynamic linking, the order does not matter, total different thing with static linking.

berak gravatar imageberak ( 2014-09-18 06:23:20 -0600 )edit

@berak: Thanks, I tried - it doesn't help.

r r gravatar imager r ( 2014-09-18 06:44:34 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-09-22 07:30:28 -0600

r r gravatar image

After all I solved this by compiling libjpeg by myself. Not sure this is the right thing to do...

edit flag offensive delete link more

Comments

It could be a good thing to do never the less. However I think moving to the master branch instead of the 3.0 alpha download will probably fix the issue also. The alpha release came with tons of bugs, have been fixed in the latest master branch already!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-23 04:09:38 -0600 )edit

Question Tools

Stats

Asked: 2014-09-18 03:36:14 -0600

Seen: 1,540 times

Last updated: Sep 22 '14