Export GDExtension on Windows

Godot Version

4.3 Stable

Question

I have a fully working Windows application when started from the editor, but exporting for Windows fails to find gdextension dlls. However using the pck unpack tool on itch.io I can see the dlls are there and in the correct directory.
I can’t find any specific documentation on exporting gdextensions.

Anyone have any idea what’s wrong?

1 Like

I don’t have an exact answer, I have worked with GDExtensions on Windows but have not exported as you have.

Did you by chance run across this page?

Yep. That page seems to be talking about mod pck files though that override the main files. I’m just trying to package in one pck.

One question is what does Godot do with the pck file at runtime. Does it unpack and run somewhere or is the file usable directly?

Alright, all I have come across is having things in the same dir, but I have not packaged them up yet.

If you do figure it out, let me know, I am curious because I have read as much as I can about GDExtensions and I have no idea what could be going on here. :slight_smile:

Can you post your .gdextension config file?

[configuration]

entry_symbol = "hlabridge_library_init"
compatibility_minimum = "4.2.1"
reloadable = true

[libraries]

macos.debug = "res://bin/libgdhlabridge.macos.template_debug.framework"
macos.release = "res://bin/libgdhlabridge.macos.template_release.framework"
windows.debug.x86_32 = "res://bin/libgdhlabridge.windows.template_debug.x86_32.dll"
windows.release.x86_32 = "res://bin/libgdhlabridge.windows.template_release.x86_32.dll"
windows.debug.x86_64 = "res://bin/libgdhlabridge.windows.template_debug.x86_64.dll"
windows.release.x86_64 = "res://bin/libgdhlabridge.windows.template_release.x86_64.dll"
linux.debug.x86_64 = "res://bin/libgdhlabridge.linux.template_debug.x86_64.so"
linux.release.x86_64 = "res://bin/libgdhlabridge.linux.template_release.x86_64.so"
linux.debug.arm64 = "res://bin/libgdhlabridge.linux.template_debug.arm64.so"
linux.release.arm64 = "res://bin/libgdhlabridge.linux.template_release.arm64.so"
linux.debug.rv64 = "res://bin/libgdhlabridge.linux.template_debug.rv64.so"
linux.release.rv64 = "res://bin/libgdhlabridge.linux.template_release.rv64.so"
android.debug.x86_64 = "res://bin/libgdhlabridge.android.template_debug.x86_64.so"
android.release.x86_64 = "res://bin/libgdhlabridge.android.template_release.x86_64.so"
android.debug.arm64 = "res://bin/libgdhlabridge.android.template_debug.arm64.so"
android.release.arm64 = "res://bin/libgdhlabridge.android.template_release.arm64.so"


Windows library search paths include the binary directory so if you put the dll next to the godot executable it will be able to find it, but thats not ideal.

What you need is to add your library dependency to dependencies section.
see here: The .gdextension file — Godot Engine (stable) documentation in English

1 Like

I’ve now added all the dependencies

[dependencies]

windows.debug = {
    "res://bin/Godot_HLA_Bridge64.dll" : "",
    "res://bin/RtiDriver64.dll" : "",
    "res://bin/pRTIEvolvedDriver64.dll" : ""
}

and it executes correctly with all the dlls in the executable directory. I can live with this.
Thanks

2 Likes

I just want to be clear, If you add the [dependencies] section the dll’s dont need to be in the same location as godot.exe

Understood, it actually works out best for my use case that they are. The issue was that unless I added the dependencies the export wouldn’t put them in the directory at all. It now works fine. Thanks for your help.

1 Like

Thanks for reiterating this, seems obvious but there are so many things to miss. :smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.