-1

I've developed a little, OpenCV dependent program in C++ with VS2015.

I would like to save it into a single *.dll file with OpenCV included in it so that I could hand it to someone who doesn't have OpenCV on their machine.

I've searched it but there's only 1 way like copy the OpenCV's *.dll-s into my project which is not that satisfying.

Program could be like:

#define dll_API __declspec(dllimport)
etc..

class dll_API ocr
public
{
  recognize(frame, int, int, ...);
  blur(frame, int, int, ..);
}
user438383
  • 5,716
  • 8
  • 28
  • 43
  • https://stackoverflow.com/questions/7583172/opencv-as-a-static-library-cmake-options – m88 Sep 07 '21 at 09:47

1 Answers1

1

If you want to embed that library into your application, you should:

  • Compile OpenCV as a static library (.lib): See this link
  • Compile your dynamic library (.dll) against OpenCV's static library
  • Ship your dynamic library as a single file
Daniel Trugman
  • 8,186
  • 20
  • 41