Moving OpenCV to another folder breaks it
Here is a weird thing. I am calling OpenCV 2.4.9 from Java (on Peppermint Linux 3).
It works fine.
But, when I rename the OpenCV installation directory (and of course the reference to the directory in my Java source) - it breaks.
Here's the error message:
java.lang.UnsatisfiedLinkError: /home/stefan/dev/opencv-2.4.9_/lib/libopencv_java249.so: libopencv_features2d.so.2.4: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
So it DID find the first library (libopencv_java249.so) - but not the second one (libopencv_features2d.so.2.4). Even though both are in the same folder.
Does OpenCV remember the folder it is installed in? Is this about an env variable? (Not aware of any variables set.)
Sources: http://tinybrain.de/1003793 (original dir) http://tinybrain.de/1003796 (moved dir)
you should have built the opencv libs statically, so opencv_java.so no more depends on other opencv so's
if you rename the folder, where the opencv so's are located, you'll have to re-run ldconfig there
Thanks. Are there not statically built libraries available online? I am looking into redistributing OpenCV for end users as easily as possible (still an unsolved problem). The software I make is supposed to require nothing but Java and download anything needed from the web.
"Are there not statically built libraries available online?"
" The software I make is supposed to require nothing but Java and download anything needed from the web."
Aren't there binary OpenCV distributions on sourceforge, or am I making this up? And isn't there a way to build Linux libraries portably?
Actually Java 8 itself is distributed this way (just untar it on any Linux and it works!) - and it's full of native libraries...
I'm still hoping for a solution here :-) A simple zip file with all the OpenCVs .so's built properly and portably?
"Aren't there binary OpenCV distributions on sourceforge,"
that's true. but they're for win only, and idk if they conttain java wrappers as well.
"A simple zip file with all the OpenCVs .so's built properly and portably?"
again that would be like 17 "simple" zips, one for win32 , one for win64, one for ...