When a make a simple test program with Logitech's LED SDK and run it, I get an UnsatisfiedLinkError with the message:
C:\Users\cwa38\AppData\Local\Temp\LogitechLedJNI.dll4587977834410494064: Can't find dependent libraries
What I have done so far:
- I downloaded the SDK from https://www.logitechg.com/en-us/innovation/developer-lab.html
- I extracted it
- I made a new Java project in NetBeans
- I added the logiled.jar file to my new project as a dependency
- I made a new class and copied the simple test program from the documentation (code is below)
- I clicked "run" and got the UnsatisfiedLinkError described above
I see that the SDK download comes with some .dll files and a .lib file, but I have no idea what to do with these files. The included documentation makes absolutely no mention of them.
What am I doing wrong?
Here is my code:
import com.logitech.gaming.LogiLED;
public class Main {
public static void main(String[] args) {
LogiLED.LogiLedInit();
LogiLED.LogiLedSetLighting(100, 0, 0);
LogiLED.LogiLedShutdown();
}
}
And here is the full documentation from Logitech (yes, it really is this short):
The following steps show how to make the Logitech SDK work with a Java program. Please adapt the steps to your game for things to work.
Steps
- Copy the SDK’s Lib\logiled.jar to your project’s directory.
- Configure your project’s Java Build Path to include the logiled.jar.
- Call the functions from the JNI wrapper in your Java code as follows:
import com.logitech.gaming.LogiLED; LogiLED.LogiLedInit(); LogiLED.LogiLedSetLighting(red,blue,green); LogiLED.LogiLedShutdown();
- Compile and run your program.
The full stack trace for the error I get is below:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\cwa38\AppData\Local\Temp\LogitechLedJNI.dll4587977834410494064: Can't find dependent libraries
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
at com.logitech.gaming.LogiLED.<clinit>(LogiLED.java:205)
at javaapplication1.JavaApplication1.main(JavaApplication1.java:20)
C:\Users\cwa38\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\cwa38\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:68: Java returned: 1