How to include all dll's in exe?

前端 未结 4 617
不知归路
不知归路 2021-02-14 16:04

I have a Visual Studio 12 project; source code written in C++; it\'s an OpenCV project. I want to give my compiled program to someone else, but, on other PC, I getting an error

4条回答
  •  有刺的猬
    2021-02-14 16:48

    the more complicated solution would be, to build static opencv libraries from src, then link your program against those, resulting in 1 large binary exe-chunk, that does not use any dlls (apart from ffmpeg, not sure about that one).

    to build static libs, you'd need to run cmake with : BUILD_SHARED_LIBS=OFF

    but take a deep breath, before doing that. linking your program will be sigificantly more difficult, because now you have to link all the zlib,libpng, whatever dependecies manually ( which before got conveniently linked into your dlls )

    again, the most simple solution is to deploy all the opencv dlls with your program.

提交回复
热议问题