• RuntimesGodot
  • 请求帮助:win7、godot3.60、mingw-gcc14.2或VS2017,编译spine-runtimes-4.2出错

win7、godot3.60、mingw-gcc14.2或VS2017,编译spine-runtimes-4.2出错:SpineSkeletonFileResource.h(68): error C3668: “SpineSkeletonFileResourceFormatLoader::load”: 包含重写说明符“override”的方法没有重写任何基类方法。RES load(const String &path, const String &original_path, Error *error)override;SpineAtlasResource.h(95): error C3668: “SpineAtlasResourceFormatLoader::load”: 包含重写说明符“override”的方法没有重写任何基类方法。

Related Discussions
...

根据你提供的信息,编译 spine-runtimes-4.2 时遇到的错误是由于 SpineSkeletonFileResource.hSpineAtlasResource.h 中的 load 方法包含 override 说明符,但没有重写任何基类方法。这可能是由于 Godot 版本与 Spine Runtimes 版本之间的不兼容导致的。

以下是一些可能的解决方案:

  1. 确认 Godot 版本:确保你使用的 Godot 版本与 Spine Runtimes 版本兼容。根据文档,spine-godot 运行时支持 Godot 3.5 和 4.x 分支。你提到使用的是 Godot 3.6.0,这可能是问题的根源。尝试使用 Godot 3.5.x 版本进行编译。

  2. 检查方法签名:确保 SpineSkeletonFileResource.hSpineAtlasResource.h 中的 load 方法签名与 Godot 基类中的方法签名完全匹配。可以参考 Godot 的文档或源码确认基类方法的签名。

  3. 更新 Spine Runtimes:确保你使用的是最新版本的 Spine Runtimes。你可以从 Spine Runtimes GitHub 仓库 下载最新版本。

  4. 编译环境:确保你的编译环境(如 MinGW 或 VS2017)配置正确,并且所有依赖项都已安装。可以参考 Godot 编译指南 进行配置。

  5. 手动修改代码:如果上述方法无效,可以尝试手动修改 SpineSkeletonFileResource.hSpineAtlasResource.h 中的 load 方法,去掉 override 说明符,或者确保其签名与基类方法匹配。

希望这些建议能帮助你解决编译问题。如果问题仍然存在,请提供更多详细信息以便进一步诊断。

处理一、去掉 override 说明符,能编译成功。但是,打开spine-runtimes4.2-example,没见spineBoy动画。
处理二、spineBoy动画预览正常。但是,godot3.6退出时崩溃。
与core/io/resource_loader.h的参数一致:
1、pineSkeletonFileResource.h/cpp的load()都加上第4个参数bool cache_mode。
RES load(const String &path, const String &original_path, Error *error)override;
2、SpineAtlasResource.h/cpp的load()都加上第4个参数bool cache_mode。

I think uor99 meant this change might cause the break in Godot 3.6 version.

godotengine/godotblob/3.5/core/io/resource_loader.h#L67

virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr);

godotengine/godotblob/3.6/core/io/resource_loader.h#L71

virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_no_subresource_cache = false);

是的,问题仍有待完美解决。期待spine-godot-cpp有更好的代码,能编译、编辑spine动画,生成的游戏也不崩溃。