How to run my app on another PC?

asked 2018-08-18 06:47:05 -0500

michlvl gravatar image

updated 2018-08-18 09:08:47 -0500


I'm using OpenCV 3.3.1 on Windows 7 64-bit and Visual Studio 2017.


Version of VS showed in Cmake as 15 2017: image description

I want to run my .exe on another PC. On target PC installed Win7(64-bit) but there are no Visual Studio and OpenCV.

How to make my application portable? I've tried to place necessary .dll files (opencv_core331d.dll, opencv_highgui331d.dll and so on) in folder with my .exe file, but it doesnt help. Moreover, I got error about missing VCRUNTIME140D.DLL and some others non-opencv libraries.

Is there detailed guidance about making OpenCV projects portable?


edit retag flag offensive close merge delete


but it doesnt help.

please be more concise here. exact errormsgs, please.

berak gravatar imageberak ( 2018-08-18 07:14:06 -0500 )edit

there's something weird here: VCRUNTIME140D.DLL is the VS2015 , not the VS2017 dependancy.

if you HAVE dlls like opencv_core331d.dll, it means, you built them locally. did you use the vc14 libs ? (not the vc15 ones)

berak gravatar imageberak ( 2018-08-18 07:20:35 -0500 )edit

ppl will have to install the redistributable for vs2015 , if it's not present on their system

berak gravatar imageberak ( 2018-08-18 07:24:15 -0500 )edit

I have checked settings in CMake, it says Visual Stidio 15 2017

michlvl gravatar imagemichlvl ( 2018-08-18 09:06:40 -0500 )edit

use a program names"depends.exe" to find the dlls your app depends,and copy these dlls with your exe in a same folder

jsxyhelu gravatar imagejsxyhelu ( 2018-08-19 02:46:53 -0500 )edit

or instead of dynamic build, go for a static build, but that is a whole new world of pain, dependencies and order of dependencies :D

StevenPuttemans gravatar imageStevenPuttemans ( 2018-08-20 09:01:46 -0500 )edit

StevenPuttemans, am I correct, that for this option I need to rebuild my opencv? In CMake BUILD_SHARED_LIBS=OFF

michlvl gravatar imagemichlvl ( 2018-08-20 10:18:58 -0500 )edit

Yes, but you will have other dependencies popping up like jpg libs and such

StevenPuttemans gravatar imageStevenPuttemans ( 2018-08-21 03:31:43 -0500 )edit