Godot Version
Godot v3.5.2
Question
I want to use Discord SDK to setup Rich Presence with Godot 3 in C#. Discord SDK has .dll
, .dylib
and .so
files and I want these files to:
- load when I start the game in the editor
- automatically export when I export my game. I only want to export specific files for specific platforms.
So in order to achieve this I did the following
- I put these files in the root folder of my project.
- I setup this GDNative singletion. I don’t exactly understand how it works, I looked it up in another plugin
[general]
singleton=true
load_once=true
symbol_prefix="discord_"
reloadable=false
[entry]
OSX.64=[ "res://discord_game_sdk.dylib" ]
Windows.64=[ "res://discord_game_sdk.dll" ]
X11.64=[ "res://discord_game_sdk.so" ]
Server=[ "res://discord_game_sdk.so" ]
[dependencies]
OSX.64=[ "res://discord_game_sdk.dylib" ]
Windows.64=[ "res://discord_game_sdk.dll" ]
X11.64=[ "res://discord_game_sdk.so" ]
Server=[ "res://discord_game_sdk.so" ]
After these procedures the Rich Presence worked both in the editor and after exporting the game.
However whenever I start the game or export it I get the following error in the Debugger
open_dynamic_library: Can't open dynamic library:
[res://discord_game_sdk.dll], error: Error 126: The specified module could not be found.
<C++ Error> Condition "!p_library_handle" is true. Returned: ERR_CANT_OPEN
<C++ Source> platform/windows/os_windows.cpp:2372 @ open_dynamic_library()
The dynamic library clearly DOES open but this error makes me think that I do something wrong and my method is incorrect. How can I correctly export .dll files or how can I otherwise get rid of this error?