Godot can't open DLL (Error 126: The specified module could not be found)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rossosaurus

I’ve been following the C++ example in the Godot 3.1 documentation and everything has been working fine until I try and use the gdexample.gdns file and attach it to the sprite. When I load up the project I get these errors:

Can't open dynamic library: C:/Users/Ross/Documents/Programming/Game Dev/Godot/Testing and Examples/Scripts/godotDocsCPPTutorial/win64/libgdexample.dll. Error: Error 126: The specified module could not be found.

 modules/gdnative/gdnative.cpp:488 - No valid library handle, can't get symbol from GDNative object

 modules/gdnative/nativescript/nativescript.cpp:1505 - No nativescript_init in "res://Scripts/godotDocsCPPTutorial/win64/libgdexample.dll" found

Here is the content of the gdns file:

[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://Scripts/godotDocsCPPTutorial/win64/gdexample.gdnlib" type="GDNativeLibrary" id=1]

[resource]
resource_name = "gdexample"
class_name = "GDExample"
library = ExtResource( 1 )
_sections_unfolder = [" Resource "]

And here is the contents of the gdnlib file it points to:

[general]
singleton=false
load_once=true
symbol_prefix="godot_"
reloadable=false

[entry]
Windows.64="res://Scripts/godotDocsCPPTutorial/win64/libgdexample.dll"
OSX.64="res://Scripts/godotDocsCPPTutorial/win64/libgdexample.dylib"
X11.64="res://Scripts/godotDocsCPPTutorial/win64/libgdexample.so"

[dependencies]

X11.64=[  ]
Windows.64=[  ]
OSX.64=[  ]

Both the gdns and gdnlib files are in the same folder as the dll itself as it says to do in the docs. Also if I try to attach gdexample.gdns to the sprite the engine ctd’s without any error and I have to reload the project. Don’t know if thats a separate bug.

Any idea what is causing this. I am using a slightly different file structure than is described in the documentation as I like to have all my examples and testing in one project with a scene/level for each example/test but I haven’t had any problems doing it this way yet.

I’m having the same problem. I don’t think it’s a typo, I’ve looked over everything several times, and it works on Linux but not on Windows.

Aaron Franke | 2021-04-21 04:23

:bust_in_silhouette: Reply From: Rossosaurus

Turns out it was a typo causing this issue. Completely my fault

Don’t say this ! I’m having the same problem without any typo ! :cry:

omomthings | 2020-03-13 21:34

Typo where? I have the same error and need help.

Michael Aganier | 2020-04-18 04:09

For me it turned out that the dll generated using gvv was faulty, don’t know why, and I was not able to build using mvsc (it was saying that many headers where missing). In the end completely removing visual studio and reinstalling everything solved the problem for mvsc and for the rest of the process!

omomthings | 2020-04-18 06:33