问题
I build opencv 233 as a static lib, but when i use it in my application, it gives link errors when calling cv::imwrite() that tiff,png,jasp libs are not linked. Is this the intention that i should link these my self in my app or did i build it wronge.
I would like that the 3party libs are static included in the opencv_highgui.lib instead of having to link them myself in my apps.

回答1:
In the solution, if configured for visual studio 2010, the 3th party libs are not set to be linked in. Change the Link Library Dependencies to true for the highgui project.
回答2:
In cmake, make sure you have BUILD_3RDPARTY, or whatever it is called, checked. OpenCV will then build lib dependencies from its own tree and statically link into highgui. This is the default for Windows.
来源:https://stackoverflow.com/questions/9966109/opencv-static-build-jpeg-png-tiff-not-static-linked