SB26
SB26

Reputation: 225

Create a standalone executable in Eclipse

I am writing a Opencv C code in eclipse -Ubuntu. I created an executable in eclipse and I am trying to run it on another ubuntu machine (Both machines have 10.10 Maverick Meerkat).But it does not work. The code is built using openCV libraries which are not available on the other machine.Is there any way to create a standalone executable. Any help is appreciated.

Thank you.

Upvotes: 2

Views: 1393

Answers (1)

mevatron
mevatron

Reputation: 14021

You'll need to compile OpenCV as a static library, and then link to it (and any other dependencies) statically with your program. You binary's size will be large, but shouldn't need any of the libraries.

When you link to OpenCV statically, you'll also need to link to all of OpenCV's dependencies statically as well. In general, make sure that if libX depends on libY, then -lY should be linked to after -lX.

Here is a recent post from someone running into issues with this in case you encounter it yourself.

Upvotes: 1

Related Questions