how to build static application?

asked 2014-03-11 14:55:42 -0500

ssh99 gravatar image

I have opencv configured in MS Visual Studio 2012.I have created GUI for my application using MSVS 12. opencv is working fine. I want to make it standalone application so that computer without opencv can run it.

I don't know how to approach this problem. Please, could you give me any suggestions?

thanks in advance.

edit retag flag offensive close merge delete



the prebuild libs are linked dynamically ( like there's a good dozen opencv* dlls that have to be present at runtime to make your prog work ). so you either have to

  • distribute the opencv dlls along with your program.
  • recompile the opencv libs statically and build your prog using static libs ( which will result in one big ~10mb chunk which does not depend on opencv dlls any more ). for this you'll have to invoke cmake with -DBUILD_SHARED_LIBS=OFF and compile the generated sln.
berak gravatar imageberak ( 2014-03-11 15:04:27 -0500 )edit

thanks i will try it out

ssh99 gravatar imagessh99 ( 2014-03-13 02:42:59 -0500 )edit