Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems creating GDExtension

I would like to create modules for Godot using C++. For that I followed this tutorial https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html.

I'm using the following environment : MSYS2 with g++ v13.2 on Windows 11, python 3.11.4 and Visual Studio Code.

So, I cloned this repo https://github.com/godotengine/godot-cpp/tree/4.1 and built it with the following command scons platform=windows -j8 use_mingw=yes. It created this static library under the bin/ folder libgodot-cpp.windows.template_debug.x86_64.a.

My first questions are : Is it bad if I have a .a file instead of a .lib file on windows to make a Godot project works ? If yes, how can I build a .lib file ? Do I have to change something in my environment ?

I then continued to follow the GDExtension tutorial and I ended up with these errors in the godot output terminal :

Godot Engine v4.1.1.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
  modules/gltf/register_types.cpp:73 - Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
--- Debug adapter server started ---
--- GDScript language server started ---
  Attempt to get non-existent interface function: string_resize
  Unable to load GDExtension interface function string_resize()
  core/extension/gdextension.cpp:476 - GDExtension initialization function 'example_library_init' returned an error.
  Failed loading resource: res://bin/gdexample.gdextension. Make sure resources have been imported by opening the project in the editor at least once.

Can someone help me resolve this please ?

like image 422
Tessan Avatar asked Sep 11 '26 16:09

Tessan


1 Answers

try cloning the exact version you're using, for example tag godot-4.1.1-stable.

relevant: https://github.com/godotengine/godot-cpp/issues/1201

like image 182
Enhex Avatar answered Sep 14 '26 06:09

Enhex