Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

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

Closed
3 tasks done
infevlol opened this issue Feb 13, 2021 · 17 comments
Closed
3 tasks done

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

infevlol opened this issue Feb 13, 2021 · 17 comments
Assignees
Labels
bug Something isn't working

Comments

@infevlol
Copy link

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:

  • I have checked for duplicate issues.
  • I have provided a detailed description of the issue.
  • I have provided reproduction steps (if applicable).
@infevlol infevlol added the bug Something isn't working label Feb 13, 2021
@LennyPhoenix LennyPhoenix changed the title Game crashes with "Attempt to call function 'new' in base "NativeScript" on a null instance" and it can't find bin/windows-64/gdsdk.dll even though it's there No valid library handle, can't get symbol from GDNative object Feb 13, 2021
@LennyPhoenix
Copy link
Owner

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

@JezSonic
Copy link
Contributor

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
Copy link
Owner

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
Copy link
Owner

Also, are you using the Debug or Release build?

@JezSonic
Copy link
Contributor

debug build

@LennyPhoenix
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

And I have Visual Studio build tools installed

@LennyPhoenix
Copy link
Owner

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

@LennyPhoenix
Copy link
Owner

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

@LennyPhoenix
Copy link
Owner

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
Copy link
Owner

This issue may be somewhat related.

@JezSonic
Copy link
Contributor

yeah, maybe

@infevlol
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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

@3ddelano
Copy link

3ddelano commented Jan 10, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants