Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem solved after a few steps. Thank you all

  1. step, to statically link your application

First, read the steps that I wrote in my question post. They're actually completely correct, just reset the CMake cache and reload the project in case of you're facing any issue. I had already done that before but the problem had not solved. The trick is, try it out again and again.

After rebuilding the application with statically linked libraries, if you're working with a video file like me, you'll probably face a new issue. Your application can't open the video file on another computer.

  1. step, to solve this

In your OpenCV build directory, there is a file named as opencv_ffmpegXXX.dll (310 in my case), put it in the same directory with your EXE.

Problem solved after a few steps. Thank you all

  1. step, to statically link your application

First, read the steps that I wrote in my question post. They're actually completely correct, just reset the CMake cache and reload the project in case of you're facing any issue. I had already done that before but the problem had not solved. The trick is, try it out again and again.

After rebuilding the application with statically linked libraries, if you're working with a video file like me, you'll probably face a new issue. Your application can't open the video file on another computer.

  1. step, to solve this

In your OpenCV build directory, there is a file named as opencv_ffmpegXXX.dll (310 in my case), put it in the same directory with your EXE.