Reputation: 625
I created on Visual Studio 2017 a DLL in C++ with a C wrapper and I am using the OpenCV
library. I installed OpenCV
on my computer, add the path of the .lib
and .dll
files in my project, and like this I am able to use my DLL in others programs. To be precise, I have now OpenCV on a folder C:\opencv\...
and my visual studio solution on C:\MG\DLL\MyDll.sln
.
But, in order to use it on another computer, I won't be able to install OpenCV
so I have to find how to package the OpenCV
library to distribute the correct files with my .dll
file. Maybe I juste have to copy the .dll
files of OpenCV
in the same folder of my DLL ?
I don't know how to deal with this, because on internet I saw some people talking for example about CMake
, others including some files in the project, ...
Moreover, I try to simulate this using a software in which I can add a C# plugin which use my C++ DLL. In this case, I rename the OpenCV
folder to be sure the link with this folder is broken. If I copy the .dll
files of OpenCV
, the plugin is not functional anymore after renaming the installation folder of OpenCV
.
Thank you in advance for sharing your experience/knowledge ;)
Upvotes: 3
Views: 4941
Reputation: 625
I solved my problem.
Copying the .dll
files is not enough. I needed to add to the PATH environment variable the folder where my DLL is with the software.
Next step, do the same thing with my Python program with doesn't recognize the openCV dll when I rename the installation folder.
Upvotes: -1
Reputation: 6666
All you need to do is copy the required OpenCV DLL files into your executable folder
Maybe I juste have to copy the .dll files of OpenCV in the same folder of my DLL ?
Yes, this is exactly all you need to do. You can even check in your development environment which DLLs you are linking to, those are the ones to copy across
How to deploy a standalone project that is based on OpenCV in Visual Studio 2010?
Upvotes: 3