dyxnie
dyxnie
CC#
Created by dyxnie on 5/13/2024 in #help
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:
<ItemGroup>
<Reference Include="hidapi.dll"/>
</ItemGroup>
<ItemGroup>
<Reference Include="hidapi.dll"/>
</ItemGroup>
My HIDapi.cs (Wrapper): https://pastebin.com/V3pRPDhk
2 replies
CC#
Created by dyxnie on 5/12/2024 in #help
Properly import dll in csproj
I am currently porting a Wii Mote Controls API from Unity to Godot and I have a couple dlls I have to import because i get the error:
E 0:00:01:0602 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:63 @ bool WiimoteApi.WiimoteManager._FindWiimotes(WiimoteApi.WiimoteType)
WiimoteManager.cs:39 @ 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:01:0602 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:63 @ bool WiimoteApi.WiimoteManager._FindWiimotes(WiimoteApi.WiimoteType)
WiimoteManager.cs:39 @ 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*)
`
16 replies