Ask Your Question

include opencv lib in a dll

asked 2016-04-19 11:26:07 -0500

ada gravatar image


I am currently trying to encapsulate my own code in a dll to provide it to another person. I use a few opencv libraries such as calib3d.lib. When I give my dll to another person I also need to provide calib3.lib. Is it possible to encapsulate all opencv libraries in my dll in order to only provide my own DLL ?

Thanks a lot,


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-04-19 11:33:25 -0500

berak gravatar image

you can build static opencv libs with


and link your dll against those

edit flag offensive delete link more


Thanks a lot for your answer. I do not exactly know how to use cmake. In visual studio, can i proceed by linking staticlib in VC++ Directories ? Should i compute an static library (.lib) or a dynamic one (.dll) ?

Thank you

ada gravatar imageada ( 2016-04-19 11:47:54 -0500 )edit

oh, ofc, if you already have static libs, - no need to rebuild, just use those !

berak gravatar imageberak ( 2016-04-19 12:06:26 -0500 )edit

If you want to read a video you will need opencv_ffmpeg.dll (with static or dynamic lib)

For static link in my configuration build_with_static_crt is off too.

I work with two folders in cmake for binaries one opencv/dynamic and another opencv/static

LBerger gravatar imageLBerger ( 2016-04-19 13:13:01 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-04-19 11:26:07 -0500

Seen: 543 times

Last updated: Apr 19 '16