godot-cpp: Win10 VS2015-built DLL: Fails to load GDNativeLibrary

Context: Windows 10 Visual Studio 2015 Community Edition Godot latest as of commit ceded65 from 06/20/2017 Having just compiled a .dll in visual studio (walkthrough in this issue from /cpp_bindings.

Issue: Built the cpp_bindings tutorial SimpleClass into the .dll. SimpleClass has no parent class it inherits from as far as the scripting language is concerned (?). Attempting to load the .gdn resource after setting it to point towards the .tres of the GDNativeLibrary appears to fail with the following errors:

EDIT: Correction, this is the actual error (I copy/pasted this from an Issue in godot_headers, my bad) Can't open dynamic library: [path to project_folder/gdtestdll.dll]. Error: 126 END EDIT

Can't open dynamic library: [path to project_folder/lib/gdtestdll.dll] Error: 126 Condition ' initialize_status != OK ' is true. Condition ' !native_library->scripts.has(p_name) ' is true. returned: 0 Condition ' !script_data ' is true.

Reproducible Steps:

Created a project that literally just throws everything into the root godot project directory. I have the following:

.import (folder) default_env.tres gdtestdll.dll gdtestdll.exp gdtestdll.ilk gdtestdll.lib gdtestdll.pdb gdtestdll.tres godot_cpp_bindings.dll godot_cpp_bindings.exp godot_cpp_bindings.lib godot_cpp_core.dll godot_cpp_core.exp godot_cpp_core.lib icon.png icon.png.import main.tscn project.godot SimpleClass.gdn

main.tscn has a single Node2D with a Built-in GDScript that simply preload’s “res://SimpleClass.gdn”

extends Node2D var SimpleClass = preload("res://SimpleClass.gdn")

SimpleClass.gdn has Class Name “SimpleClass” and is pointing to res://gdtestdll.tres which in turn has its Windows value set to res://gdtestdll.dll

I set the default GDNativeLibrary in Project Settings to be res://gdtestdll.tres.

Despite all of that, it’s still unable to “locate the module” as per Error 126 in Visual Studio

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 23 (23 by maintainers)

Commits related to this issue

Most upvoted comments

@willnationsdev Did you manage to fix this? I had the same error and got it working if you still need a hand