views:

794

answers:

2

Hi, I have a Java Application which has to load an DLL with a few dependencies. I copied all required DLLs in the same folder. The DLL I was set up uses the SeeingMachine FaceApi libraries. Now when I'm starting the Java application I will get an error the my DLL can't find the dependencies:

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\[..]\bin_dbg\HeadTrackerDLL.dll: Can't find dependent libraries
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(Unknown Source)
            at java.lang.ClassLoader.loadLibrary(Unknown Source)
            at java.lang.Runtime.loadLibrary0(Unknown Source)
            at java.lang.System.loadLibrary(Unknown Source)
            at Tracker.<clinit>(Tracker.java:12)
            at TrackerControls.<init>(TrackerControls.java:18)
            at Main.main(Main.java:6)

How can I solve the problem? Because Dependency Walker does not show any error. And I don't wanna load ALL DLL files manually.

+1  A: 

So i think i fixed my problem with the mt.exe tool.

mt.exe -manifest HeadTrackerDLL.dll.intermediate.manifest -outputresource:HeadTrackerDLL.dll;2

With this codeline the manifest file and the dll file will be packed into the dll file so all dependencies located.

My application runs. I hope this was the solution.

sn3ek
A: 

I have same problem . after executing the MT.exe .. its working fine .. thanks a lot

vijayapandian