HamoudaOthman / javacv

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

dll problem #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Installed OpenCV 2.2.0
2. Put javacpp.jar, javacv-windows-x86_64.jar and javacv.jar in classpath
3. Used the Demo sample from quickstart.

What is the expected output? What do you see instead?
No exception in stacktrace. I see the exception provided in additional 
information.

What version of the product are you using? On what operating system?
javacv-bin-20110407.zip, windows 7 64 bits operating system, 
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

Please provide any additional information below.
Please find below the stacktrace that I encounter:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
C:\Users\stefan\AppData\Local\Temp\jniopencv_core2006555750745685797.dll: %1 is 
not a valid Win32 application
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1003)
    at com.googlecode.javacpp.Loader.load(Loader.java:332)
    at com.googlecode.javacpp.Loader.load(Loader.java:266)
    at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:120)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:286)
    at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:87)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:286)
    at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:88)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:286)
    at com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:85)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:286)
    at com.sample.Example.main(Example.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)

Process finished with exit code 1

Original issue reported on code.google.com by bstef...@gmail.com on 4 May 2011 at 12:19

GoogleCodeExporter commented 9 years ago
Installing opencv(C:\OpenCV2.2) in the default location partially solves the 
problem. I think hardcodings in opencv_core.java should do the trick in future. 
Anyway after doing this you get:

Exception in thread "main" java.lang.UnsatisfiedLinkError: 
C:\Users\stefan\AppData\Local\Temp\jniopencv_core1286255167459062460.dll: Can't 
find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1003)
    at com.googlecode.javacpp.Loader.load(Loader.java:332)
    at com.googlecode.javacpp.Loader.load(Loader.java:266)
    at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:120)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:286)
    at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:87)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:286)
    at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:88)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:286)
    at com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:85)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:286)
    at com.sample.Example.main(Example.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)

Original comment by bstef...@gmail.com on 4 May 2011 at 1:59

GoogleCodeExporter commented 9 years ago
OpenCV 2.2 does not come with binaries for 64-bit Windows. You need to compile 
them yourself

Original comment by samuel.a...@gmail.com on 5 May 2011 at 2:00

GoogleCodeExporter commented 9 years ago
In case anyone is encountering this issue as well,
a simple fix is to use the 32bit JDK instead of the 64bit JDK, this solves the 
linking error.

Original comment by jkirschn...@gmail.com on 6 May 2011 at 5:02

GoogleCodeExporter commented 9 years ago
I am using 32bit JDK and me too getting above exception 
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Documents and 
Settings\Comp\Local Settings\Temp\jniopencv_core6193263930032021817.dll: %1 is 
not a valid Win32 application.

What is missing please help.

Original comment by bhush.fa...@gmail.com on 20 Mar 2012 at 4:28

GoogleCodeExporter commented 9 years ago
Please make sure to follow the instructions here:
Common issues with OpenCV under Windows 7 
http://code.google.com/p/javacv/wiki/Windows7AndOpenCV

Original comment by samuel.a...@gmail.com on 21 Mar 2012 at 4:45