Hi all. I'm new to Godot, and I'm currently trying to make use of a library of mine for a project in Godot. In this library, I use cURL, and everything seemingly compiles fine. When I start the game however, it seems like it can't load my .dll-file which I compiled. It's only when I reference curl-functions in my code, such as curl_easy_init. So it seems like libcurl.dll or so isn't loaded properly as a dependency. Any suggestions on how I can debug this or solve it?

ERROR: Can't open dynamic library: C:/Users/james/Documents/GitHub/godot-native-example/app/addons/example/gdnative-example.dll, error: Error 126: The specified module could not be found. . at: (platform/windows/os_windows.cpp:2353) ERROR: No valid library handle, can't get symbol from GDNative object at: get_symbol (modules/gdnative/gdnative.cpp:510) ERROR: No nativescript_init in "res://addons/example/gdnative-example.dll" found at: init_library (modules/gdnative/nativescript/nativescript.cpp:1510) ERROR: Error opening file 'res://icon.png'. at: load_image (core/io/image_loader.cpp:55)

The game runs fine as long as I don't try to use curl_easy_init or any other curl function.

    [general]

    singleton=false load_once=true symbol_prefix="godot_" reloadable=true

    [entry]

    Windows.64="res://addons/example/gdnative-example.dll"

    [dependencies]

    Windows.64=[ "res://addons/example/libcurl.dll", "res://addons/example/libeay32.dll", "res://addons/example/libssh2.dll" ]

    a month later

    I remember having some similar issues when setting up a network layer of my own in GDnative, I can try to guide you to a solution.

    1 Check to make sure its not a linker issue from your gdnative project code, make sure you have the libcurl.lib referenced, or other projects depending on how your curl is linked to the libssh2.lib or libeay32.lib. If this is visual studio based it would be under project properties under linker/input under additional dependencies.

    2 If all that is fine, then the files need to be in the same location as the dll your gdnative project, or at least this is how it is setup by default. So wherever gdnative-example.dll is you need curl.dll and other dependent dll's that curl needs.

    3 Make sure you have all the proper setup gdnlib and gdns files setup to load your dll. a. In gdns the class name has to be whatever your class name is within that dll, if the class name is Example() then it needs to be that without the params of course just the name of the class. b. In gdnlib make sure your entry is setup correctly. i.e Windows 64/32 bit with the dynamic library in the res://whereever you have this file. And that the Gdns has this gdnlib linked to it.

    If these all fail try to build the DLL with the curl hooks in a separate project and link it to make sure everything in it works without touching Godot at all. If it fails at different spots, you might have to fix code within it first then link it correctly into Godot.

    Hope this leads you in the right direction.

    6 months later

    Hey! I'm in the exact same situation today, did you find where was the issue, james-newnorth ? I've followed this tutorial:

    and I tried to add an external lib in the process. Added the include folder in Visual Studio 2022, Added the lib folder as a dependency folder, name explicitly the correct .lib files, it compile correctly but any call to a function from the external lib make my custom library unavailable when running the Godot project.

    3 months later