Can't find dependent libraries - CTRE_PhoenixCCI.dll
Opened this issue · 4 comments
When running WPILib: Simulate Robot Code On Desktop
, this error appears:
java.lang.UnsatisfiedLinkError: C:\Users\David\Documents\Robot Code\Robot2019\build\tmp\jniExtractDir\CTRE_PhoenixCCI.dll: Can't find dependent libraries
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2649)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)
at java.base/java.lang.System.loadLibrary(System.java:1867)
at com.ctre.phoenix.CTREJNIWrapper.<clinit>(CTREJNIWrapper.java:9)
at com.ctre.phoenix.motorcontrol.can.BaseMotorController.<init>(BaseMotorController.java:54) at com.ctre.phoenix.motorcontrol.can.TalonSRX.<init>(TalonSRX.java:27)
at com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX.<init>(WPI_TalonSRX.java:49)
at org.usfirst.frc.team3735.robot.util.hardware.VortxTalon.<init>(VortxTalon.java:31) at org.usfirst.frc.team3735.robot.util.hardware.VortxTalon.<init>(VortxTalon.java:37)
at org.usfirst.frc.team3735.robot.subsystems.Drive.<init>(Drive.java:75) at org.usfirst.frc.team3735.robot.Robot.robotInit(Robot.java:70)
at org.usfirst.frc.team3735.robot.util.bases.VortxIterative.startCompetition(VortxIterative.java:71) at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:263)
at org.usfirst.frc.team3735.robot.Main.main(Main.java:20)
Currently getting past this by commenting these two lines in Robot.java:
drive = new Drive();
navigation = new Navigation();
Windows or Mac? That file is not likely to be a correct shared lib on a mac (I guess they could have named it that, but usually it will end in .so)
Does the simulator support simulating the Talons? If not, we have to code some mock classes to use when running under the simulator.
I'm running Windows.
From what I am hearing around, Simulator is currently not supporting using the Talons.
I'm having to make sure that they are never referenced. So far, commenting out those two lines does it for now.
I suggest reading about Mock Objects (https://en.wikipedia.org/wiki/Mock_object) to avoid commenting stuff in and out for simulation. We'll also probably need to do a little with dependency injection that will be similar to dynamically loading robot sub systems. The proper way to perform the mock/dependency injection is through Inversion of Control (https://en.wikipedia.org/wiki/Inversion_of_control).