Ask Your Question
0

include opencv lib in a dll

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

ada gravatar image

Hello,

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,

Anthony

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

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

berak gravatar image

you can build static opencv libs with

cmake -DBUILD_SHARED_LIBS=OFF

and link your dll against those

edit flag offensive delete link more

Comments

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 -0600 )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 -0600 )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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 793 times

Last updated: Apr 19 '16