rindarith / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

Cant load OpenCV libraries without root access #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to use JavaCV objects (say, create an IplImage) without root access.

What is the expected output? What do you see instead?

One would expect the program to run without issues, creating the IplImage.

The output we get is the following:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load 
library 'highgui': libcv.so.2.1: cannot open shared object file: No such file 
or directory
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:200)
    at name.audet.samuel.javacv.jna.Loader.load(Loader.java:44)
    at name.audet.samuel.javacv.jna.highgui.<clinit>(highgui.java:76)
    at com.hid.iod.imageprocessing.HidImage.<init>(TestImage.java:77)

The exact line where it fails is:
originalImage = cvLoadImage(location);

This is the first line in my code which summons a JavaCV object

What version of the product are you using? On what operating system?

I am using Java 1.6, JDK 6, OpenCV 2.1.0, JNA 3.2.5, and JavaCV 20100730. This 
is on RedHat Enterprise Linux Server Release 5.5 (Tikanga).

Please provide any additional information below.

The opencv libraries are in /usr/local/lib64/, which has chmod 777 (rwx for 
all).

Original issue reported on code.google.com by nsul...@gmail.com on 28 Dec 2010 at 7:37

GoogleCodeExporter commented 9 years ago
Just for clarification purposes, my code runs perfectly if I have root access. 
It is without root access that it fails.

Original comment by nsul...@gmail.com on 28 Dec 2010 at 7:38

GoogleCodeExporter commented 9 years ago
Could you try JNA 3.2.7 and the latest version of JavaCV? Thank you

Original comment by samuel.a...@gmail.com on 29 Dec 2010 at 1:53

GoogleCodeExporter commented 9 years ago
Hi Samuel,

That seemed to fix it perfectly. Thanks so much!

Original comment by nsul...@gmail.com on 29 Dec 2010 at 10:30

GoogleCodeExporter commented 9 years ago

Original comment by samuel.a...@gmail.com on 30 Dec 2010 at 2:00