godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.74k stars 575 forks source link

Godot-CPP think GDExtension built for Godot 4.4? #1643

Open SentimeterGG opened 17 hours ago

SentimeterGG commented 17 hours ago

Godot version

4.3.stable

godot-cpp version

4.3.stable

System information

Arch Linux

Issue description

To identify the source of the issue, I traced the error to godot-cpp/src/godot.cpp, specifically at line 323. I then modified the godot.cpp file to address the version compatibility check. from this:

if (!compatible) {
    // We need to use snprintf() here because vformat() uses Variant, and we haven't loaded
    // the GDExtension interface far enough to use Variants yet.
    char msg[128];
    snprintf(msg, 128, "Cannot load a GDExtension built for Godot %d.%d.%d using an older version of Godot (%d.%d.%d).",
             GODOT_VERSION_MAJOR, GODOT_VERSION_MINOR, GODOT_VERSION_PATCH,
             internal::godot_version.major, internal::godot_version.minor, internal::godot_version.patch);
    ERR_PRINT_EARLY(msg);
    return false;
}

I modified it to the following:

if (!compatible) {
    // Using snprintf() here because vformat() relies on Variant, which is unavailable at this stage
    // of the GDExtension interface initialization.
    char msg[128];
    snprintf(msg, 128, "Cannot load a GDExtension built for Godot %d.%d.%d using an older version of Godot (%d.%d.%d). (This may be a bug.)",
             GODOT_VERSION_MAJOR, GODOT_VERSION_MINOR, GODOT_VERSION_PATCH,
             internal::godot_version.major, internal::godot_version.minor, internal::godot_version.patch);
    ERR_PRINT_EARLY(msg);
    return true;
}

This changes bypass the checking and forces the GDExtensions to be run I’m not sure if this is a bug or if I might be mistaken. so i put it in here

Steps to reproduce

create a new project using godot-cpp version 4.3.stable

Minimal reproduction project

N/A

Ivorforce commented 10 hours ago

I have no issues with the 4.3 branch (56571dc584ee7d14919996c6d58fb5b35e64af63). Can you post the exact commit hash you're on, as well as the version info from the Godot client you're using?

Ideally, please provide a reproduction project where the issue occurs.