LennyPhoenix / GodotDiscordSDK

A Discord Game SDK wrapper for Godot, written in C.
MIT License
54 stars 5 forks source link

No valid library handle, can't get symbol from GDNative object #7

Closed infevlol closed 3 years ago

infevlol commented 3 years ago

Describe the bug Game crashes with error: "Attempt to call function 'new' in base "NativeScript" on a null instance" and it can't find bin/windows-64/gdsdk.dll

To Reproduce Just run the test project

Expected behaviour Discord.Core class is loaded properly as an NativeScript call and I can call it's functions anywhere in the code

Screenshots image

Additional context Log output: Godot Engine v3.2.3.stable.official - https://godotengine.org OpenGL ES 3.0 Renderer: Radeon RX 570 Series

ERROR: Can't open dynamic library: D:/Biblioteki/Pobrane/demo/bin/windows-64/gdsdk.dll, error: Error 126: Nie można odnaleźć określonego modułu. . At: platform/windows/os_windows.cpp:2395:open_dynamic_library() - Condition "!p_library_handle" is true. Returned: ERR_CANT_OPEN ERROR: No valid library handle, can't get symbol from GDNative object At: modules/gdnative/gdnative.cpp:501:get_symbol() - No valid library handle, can't get symbol from GDNative object ERROR: No nativescript_init in "res://bin/windows-64/gdsdk.dll" found At: modules/gdnative/nativescript/nativescript.cpp:1506:init_library() - No nativescript_init in "res://bin/windows-64/gdsdk.dll" found

Please confirm the following:

LennyPhoenix commented 3 years ago

Did you compile the library yourself or did you use the GitHub Actions build?

JezSonic commented 3 years ago

i sent him github actions build with discord sdk 2.5.6 libs with the demo for his platform and everything was placed properly

LennyPhoenix commented 3 years ago

Could you send a screenshot of the bin/windows-64 folder? It points towards the files not being located, a screenshot of the .gdnlib folder would also be nice.

LennyPhoenix commented 3 years ago

Also, are you using the Debug or Release build?

JezSonic commented 3 years ago

debug build

LennyPhoenix commented 3 years ago

Ah, so my guess is that you don't have the Visual Studio build tools installed, so the debug build won't work. Try using the Release build instead? The Debug build is mainly for developing the SDK.

infevlol commented 3 years ago

Could you send a screenshot of the bin/windows-64 folder? It points towards the files not being located, a screenshot of the .gdnlib folder would also be nice.

image

infevlol commented 3 years ago

And I have Visual Studio build tools installed

LennyPhoenix commented 3 years ago

Slight side note, you shouldn't need to have the .lib file in there

LennyPhoenix commented 3 years ago

Could you try compiling the library yourself? It could be something to do with the Actions build

LennyPhoenix commented 3 years ago

As a last thing to try, you say that @JezSonic sent all the files you needed? Could you try downloading the sdk and performing setup normally following the instructions in the docs (there is a setup.bat batch file in the repo)

LennyPhoenix commented 3 years ago

This issue may be somewhat related.

JezSonic commented 3 years ago

yeah, maybe

infevlol commented 3 years ago

Could you try compiling the library yourself? It could be something to do with the Actions build

I can't

As a last thing to try, you say that @JezSonic sent all the files you needed? Could you try downloading the sdk and performing setup normally following the instructions in the docs (there is a setup.bat batch file in the repo)

Tried it, still the same

LennyPhoenix commented 3 years ago

Could you try compiling the library yourself? It could be something to do with the Actions build

I can't

Why not? Is there an error with the compiler?

LennyPhoenix commented 3 years ago

I'll add a note about this in the README.

3ddelano commented 2 years ago

If you get this error "cant load dynamic library", I found a fix for it. Simple move all the compiled library files aka .dll, .so, .dylib to the root of the godot project aka the same folder where the project.godot file is. Also move the discord's compiled libraries aka discord_game_sdk.dll/.so/.dylib again to the root folder. And then update the gdnlib to point to the new locations.