sumit
sumit

Reputation: 141

How can i use Opencv build in one Linux PC to the other?

I am trying to create a C++ application with opencv and share the application with other user who donot have Opencv installed on its PC. How can i do that?

I tried :

  1. I copied all the header files, source files and libraries in some /home/myfolder path.
    1. I created the application and link all the files stored in /home/myfolder.
    2. set the environment variable LD_LIBRARY_PATH to point /home/myfolder in .bashrc file so that application can find the libraries during run time.

I was able to compile on my PC, but when i share my folder with some other PC and link all the libraries, I get undefined reference error for Opencv.

Thanks

Upvotes: 5

Views: 216

Answers (2)

yotabyte
yotabyte

Reputation: 188

The answer is static linking. If you don't care about executable size and the target machine doesn't have the required libraries, just supply them inside the executable. Please look at this question for reference.

Upvotes: 1

Mark Setchell
Mark Setchell

Reputation: 207758

This answer has security implications - inform yourself before using and only use on a private network.


You could let the other user ssh into your PC and forward the X11 connection to his own machine using the -X or -Y options.

So, the other user would do:

ssh -Y someUser@yourPC yourApp

You will need to think about whether you want to trust that person to login as you, or whether you wanted to make a different user on your PC that could only run your specific app and no other.


Another option might be to let the other user make his X11 display available to your PC, by him typing the following on his machine:

xhost +

Then, you could start your app on your machine, but with the display forwarded to his machine - that way he doesn't need to log in to your machine or have your password:

DISPLAY=<otherPC>:0  yourApp

Upvotes: 0

Related Questions