我想使用 C++ 为 Godot 创建模块。 为此,我遵循了本教程https://docs.godotengine.org/en/stable/tutorials/scripting/gdextension/gdextension_cpp_example.html.
我使用以下环境:Windows 11 上的 MSYS2 和 g++ v13.2、python 3.11.4 和 Visual Studio Code。
所以,我克隆了这个存储库https://github.com/godotengine/godot-cpp/tree/4.1并使用以下命令构建它
scons platform=windows -j8 use_mingw=yes
。它在 bin/ 文件夹下创建了这个静态库libgodot-cpp.windows.template_debug.x86_64.a
。
我的第一个问题是:如果我在 Windows 上使用 .a 文件而不是 .lib 文件来使 Godot 项目正常运行,会不会很糟糕?如果是,我该如何构建 .lib 文件?我需要改变我的环境吗?
然后我继续遵循 GDExtension 教程,最终在 godot 输出终端中出现了这些错误:
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.
有人可以帮我解决这个问题吗?