ChitraPathak / javacv

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

javacv throws java.lang.UnsatisfiedLinkError #131

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have created a new netbeans project, included all jars (javacpp.jar, 
javacv.jar, javacv-*.jar), also copied all dlls from javacv-windows-x86.jar to 
c:\windows\system32; my simple java class looks like the following:

    public static void main(String[] args)  throws Exception {
        try{
            // Preload the opencv_objdetect module to work around a known bug.
        Loader.load(opencv_objdetect.class);
        // OpenCVFrameGrabber uses opencv_highgui, but other more versatile FrameGrabbers
        // include DC1394FrameGrabber, FlyCaptureFrameGrabber, OpenKinectFrameGrabber,
        // VideoInputFrameGrabber, and FFmpegFrameGrabber.
        FrameGrabber grabber = new OpenCVFrameGrabber(0);
        grabber.start();
        final IplImage image = grabber.grab();
        final BufferedImage img = image.getBufferedImage();
        ImageIO.write(img, "png", new File("out.png"));
        grabber.stop();
        }catch(Throwable t){
            t.printStackTrace();
            Thread.sleep(10000);
        }
    }

However, the program crashes with:

java.lang.UnsatisfiedLinkError: 
C:\Users\vyzivus\AppData\Local\Temp\jniopencv_core5162948864453917615.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:337)
    at com.googlecode.javacpp.Loader.load(Loader.java:271)
    at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:126)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:96)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:91)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at com.googlecode.javacv.cpp.opencv_features2d.<clinit>(opencv_features2d.java:93)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:97)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at javaapplication5.JavaApplication5.main(JavaApplication5.java:28)

I'm on 32-bit Windows Vista. Thanks!

Original issue reported on code.google.com by martin.v...@gmail.com on 10 Nov 2011 at 4:42

GoogleCodeExporter commented 9 years ago
The C:\Users\vyzivus\AppData\Local\Temp\jniopencv_core5162948864453917615.dll 
dll is missing in the Temp\ directory.

Original comment by martin.v...@gmail.com on 10 Nov 2011 at 4:43

GoogleCodeExporter commented 9 years ago
I'm terribly sorry, I just read the wiki page 
http://code.google.com/p/javacv/wiki/Windows7AndOpenCV
It helped and the program works now.
Thank you!

Original comment by martin.v...@gmail.com on 10 Nov 2011 at 4:56

GoogleCodeExporter commented 9 years ago
Ok, good!

Original comment by samuel.a...@gmail.com on 15 Nov 2011 at 10:34