How to fix Java JNI DLL dependencies
I have a Java application that needs to load a DLL with multiple dependencies. I copied all the required DLLs in one folder. DLL I was created using the SeeingMachine FaceApi libraries. Now when I run my Java application I get an error that my DLL cannot find 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 doesn't show any errors. And I don't want to load ALL DLLs manually.
+2
source to share
1 answer
So, I figured I fixed my problem with the mt.exe tool.
mt.exe -manifest HeadTrackerDLL.dll.intermediate.manifest -outputresource:HeadTrackerDLL.dll;
In this encoding, the manifest file and dll file will be packaged into a dll file so that all dependencies are found.
My application is running. Hopefully this is the solution.
+2
source to share