Shipping binary with external dependencies

Hi. I need some kind of template matching in my app, so i have to ship it with opencv library.
However my target audience probably will not have that on their computers.
My first guess was creating installer/script that will install it on their machine, but as i said they are not tech guys and it might look scary for them.
So my second guess is shipping binary with my own pre-built opencv library.

But it sounds really complicated as i have to build all opencv's deps statically and build opencv itself (statically or dynamically i probably don't care) and i don't really have experience doing that. So that's a lot of things to do as i have to cross compile all opencv's deps.

Is it how we do that or is there better way?

This really comes down to how you want to maintain updates imo. With static linking, you have to always update the entire binary, and also handle the bulk of statically linking it (I am unsure of how big that will be). If you dynamically link it, however, you can always place the library adjacent, which will make updating opencv itself easier, without replacing the entire binary.

If you want to look at doing it statically, there is an issue on the repo about it: statically compiling opencv · Issue #364 · twistedfall/opencv-rust.

1 Like

That's really helpful.
I also, somehow, overlooked the github release. They have option to just download dynamic library. I guess that's what i'll use for now