rindarith / javacv

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

undefined symbol error when using opencv-2.3.1 #117

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem? Compiling a simple program.

I amusing Ubuntu 11.04, on an AMD 64 bit machine.

Using Opencv 2.2, and the javacv-bin version from June 2011, I could compile a  
clojure programs that worked fine with most of the opencv/javacv routines.  

I have recently needed to convert between the opencv format (cvmat) and an 
IplImage format.  To that end, I tried a simple program that would load a 
buffered image, create an IplImage using opencv_core$IplImage/createFrom, but I 
get an error saying that it could not save the IplImage using cvSaveImage.  All 
other aspects of the interface between javacv (finding contours, loading 
saving), and opencv 2.2 appeared to cause no problems-- just the conversion of 
bufferedimages to iplimages. I thought this problem might have been solved in a 
more recent version of javacv.   

I therefore downloaded the most recent javacv-bin files, and then downloaded 
Opencv 2.3.1, and compiled it.  The opencv self-tests run fine.

However, when I now go to compile the same program that was used in the earlier 
version of javacv and Opencv 2.2, I get a symbol-not-found error e.g.
the compiler complains:

Unknown location:
  error: java.lang.UnsatisfiedLinkError: /tmp/libjniopencv_core426902910738438552.so: /opt/OpenCV-2.3.1/release/lib/libopencv_core.so.2.3: undefined symbol: mx_ippsLn_32f_A21

Compilation failed.

I believe I have properly linked the new opencv libraries, and included the 
proper jars in the Classpath.  As I said, I can get javacv to work using Opencv 
2.2, and the javacv-bin versions from june 2011, but I cannot seem to get the 
new combination of Opencv 2.3.1 and the October 2011 javacv to work properly.  

I suppose one option is to try to compile javacv rather than use the existing 
javacv-bin files, but I am principally a clojure programmer and the intricacies 
of compiling javacv (if it is more than typeing 'ant' in the directory) are 
currently beyond me.

Suggestions would be appreciated. 

thanks
Blake

Original issue reported on code.google.com by cabjh...@embarqmail.com on 17 Oct 2011 at 4:17

GoogleCodeExporter commented 9 years ago
As an update, I used NetBeans and copied the Demo program given on the javacv 
project front page for the haarcascade, compiled it, and than ran it using 
Opencv2.3.1, and the 10-01-11 javacv-bin jars.  I get the same 'undefined 
symbol' error as with clojure: 

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
/tmp/libjniopencv_core5822925250382781760.so: 
/opt/OpenCV-2.3.1/release/lib/libopencv_core.so.2.3: undefined symbol: 
mx_ippsLn_32f_A21
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703) .....

So I don't think it is a Clojure issue.  

Original comment by cabjh...@embarqmail.com on 18 Oct 2011 at 1:27

GoogleCodeExporter commented 9 years ago
The function "mx_ippsLn_32f_A21" is part of Intel's IPP. Either do not compile 
OpenCV with IPP enabled, or please install IPP properly...

Original comment by samuel.a...@gmail.com on 19 Oct 2011 at 3:05

GoogleCodeExporter commented 9 years ago
Bingo!  I disabled the IPP compilation, and the error went away.  Thanks!

Original comment by cabjh...@embarqmail.com on 19 Oct 2011 at 12:25