Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV 2.4 static lib relies on opencv_ffmpeg*.dll on Windows

I want to compile a simple C program which I would like to statically link to opencv*.lib files. I am doing thin on Windows 64bit, with VS 2013.

I have included the include directory, the opencv\build\x64\vc12\staticlib directory, and all the necessary .lib files. The compilation went smoothly, but the program won't execute. More specifically,

VideoCapture::open(*filename*)

will fail, and

VideoCapture::isOpened()

will return false. But no exception of any kind is thrown.

I noticed if I put my executable under opencv\build\x64\vc12\bin, the program will work as expected. So I tried the combination of the DLLs and my program, and I found opencv_ffmpeg*.dll is the one causing my problem.

It seems to me that the static lib is dynamically linking to this ffmpeg DLL. So even my program can run without DLLs from opencv, I still need to satisfy the dependencies of the static lib, which is a dynamic lib...so complicate.