not properly import dll in c# godot
tried recompiling the dll with the c and h file im pretty sure were used:
hidapi.c:
https://pastebin.com/FnPPsZM8
hidapi.h:
https://pastebin.com/JK74uLyc
Command i used for compiling:
gcc -shared -o hidapi.dll hidapi.c -lsetupapi
How i reference it in my csproj:
My HIDapi.cs (Wrapper):
https://pastebin.com/V3pRPDhk
<ItemGroup>
<Reference Include="hidapi.dll"/>
</ItemGroup>
<ItemGroup>
<Reference Include="hidapi.dll"/>
</ItemGroup>
1 Reply
Error:
E 0:00:00:0962 nint HIDapi.hid_enumerate(ushort, ushort): System.DllNotFoundException: Unable to load DLL 'hidapi' or one of its dependencies: The specified module could not be found. (0x8007007E)
<C++ Error> System.DllNotFoundException
<C++ Source> :0 @ nint HIDapi.hid_enumerate(ushort, ushort)
<Stack Trace> :0 @ nint HIDapi.hid_enumerate(ushort, ushort)
WiimoteManager.cs:67 @ bool WiimoteApi.WiimoteManager._FindWiimotes(WiimoteApi.WiimoteType)
WiimoteManager.cs:41 @ bool WiimoteApi.WiimoteManager.FindWiimotes()
WiimoteConnection.cs:42 @ void WiimoteConnection.FindWiimotes()
WiimoteTest.cs:15 @ void WiimoteTest._Ready()
Node.cs:2137 @ bool Godot.Node.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
WiimoteTest_ScriptMethods.generated.cs:48 @ bool WiimoteTest.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
CSharpInstanceBridge.cs:24 @ Godot.NativeInterop.godot_bool Godot.Bridge.CSharpInstanceBridge.Call(nint, Godot.NativeInterop.godot_string_name*, Godot.NativeInterop.godot_variant**, int, Godot.NativeInterop.godot_variant_call_error*, Godot.NativeInterop.godot_variant*)
E 0:00:00:0962 nint HIDapi.hid_enumerate(ushort, ushort): System.DllNotFoundException: Unable to load DLL 'hidapi' or one of its dependencies: The specified module could not be found. (0x8007007E)
<C++ Error> System.DllNotFoundException
<C++ Source> :0 @ nint HIDapi.hid_enumerate(ushort, ushort)
<Stack Trace> :0 @ nint HIDapi.hid_enumerate(ushort, ushort)
WiimoteManager.cs:67 @ bool WiimoteApi.WiimoteManager._FindWiimotes(WiimoteApi.WiimoteType)
WiimoteManager.cs:41 @ bool WiimoteApi.WiimoteManager.FindWiimotes()
WiimoteConnection.cs:42 @ void WiimoteConnection.FindWiimotes()
WiimoteTest.cs:15 @ void WiimoteTest._Ready()
Node.cs:2137 @ bool Godot.Node.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
WiimoteTest_ScriptMethods.generated.cs:48 @ bool WiimoteTest.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name&, Godot.NativeInterop.NativeVariantPtrArgs, Godot.NativeInterop.godot_variant&)
CSharpInstanceBridge.cs:24 @ Godot.NativeInterop.godot_bool Godot.Bridge.CSharpInstanceBridge.Call(nint, Godot.NativeInterop.godot_string_name*, Godot.NativeInterop.godot_variant**, int, Godot.NativeInterop.godot_variant_call_error*, Godot.NativeInterop.godot_variant*)