1

I am trying to use a program utilizing OpenCV on a PC that does not have OpenCV installed. Trying to start the program results in the following error:

"This program can't start because opencv_world320.dll is missing from your computer. Try reinstalling the program to fix the problem."

Now I know this normally happens if the correct libraries are not linked or linking was not static but as pre-built OpenCV 3.2 only uses a single library and after double checking that runtime library is set to /MT in VS2015 I have no idea why this error is still present.

Looking at the built .exe file in a PE Analyzer also shows that opencv_world320.dll is still listed as an import.

How to fix this?

Moonbear
  • 21
  • 5
  • For anyone running into the same problem, here is how I did it after Miki's pointers: http://dogfeatherdesign.com/opencv-3-0-microsoft-visual-studio-2015-cmake-and-c/ – Moonbear Feb 02 '17 at 07:54

1 Answers1

3

OpenCV 3.2 prebuild only provides x64 dynamic libraries for vc14.

The .lib you're trying to link (in subfolder x64\vc14\lib) is a import library, that contains the symbols to allow the linker to link to the dll. See here and here for further details on the matter.

In practice, if you want to static link to OpenCV, you need to rebuild it. You'll find the static libraries in subfolder x64\vc14\staticlib.

Community
  • 1
  • 1
Miki
  • 40,887
  • 13
  • 123
  • 202
  • The `staticlib` folder is not provided anymore with 3.2 as far as I can see. Thanks a lot though, I will look into it. – Moonbear Jan 30 '17 at 13:00
  • 1
    It'll be there after you recompile opencv with static linkage – Miki Jan 30 '17 at 13:02
  • @Miki , I am using windows, I compiled OpenCV 3.4.2 in CMAKE with the flag "BUILD_SHARED_LIBS " Off, now I should open OpenCV.sln , and rebuild all ? In OpenCV 3.4.2 It creates folder named "lib" with all the libs, is it the same one as x64\vc14\staticlib ? – Stav Bodik Aug 23 '18 at 11:54