MizunagiKB / gd_cubism

Unofficial Live2D Player for Godot Engine
https://mizunagikb.github.io/gd_cubism/
Other
144 stars 17 forks source link

Windows 10 OS Cubism Build Error #67

Closed albertkun closed 6 months ago

albertkun commented 7 months ago

はじめまして!gd_cubismを作ってくれてありがとうございます!だけど、このエラーが哀れってビルド進めない!

internal_cubism_renderer_2d.cpp
internal_cubism_renderer.cpp
internal_cubism_user_model.cpp
internal_cubism_renderer_resource.cpp
src\gd_cubism_motion_entry.hpp(59): error C2248: 'GDCubismMotionQueueEntryHandle::HandleError': cannot access private enum declared in class 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(30): note: see declaration of 'GDCubismMotionQueueEntryHandle::HandleError'
src\gd_cubism_motion_entry.hpp(26): note: see declaration of 'GDCubismMotionQueueEntryHandle'
scons: *** [src\gd_cubism_effect.windows.template_debug.x86_64.obj] Error 2
src\gd_cubism_motion_entry.hpp(59): error C2248: 'GDCubismMotionQueueEntryHandle::HandleError': cannot access private enum declared in class 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(30): note: see declaration of 'GDCubismMotionQueueEntryHandle::HandleError'
src\gd_cubism_motion_entry.hpp(26): note: see declaration of 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(59): error C2248: 'GDCubismMotionQueueEntryHandle::HandleError': cannot access private enum declared in class 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(30): note: see declaration of 'GDCubismMotionQueueEntryHandle::HandleError'
src\gd_cubism_motion_entry.hpp(26): note: see declaration of 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(59): error C2248: 'GDCubismMotionQueueEntryHandle::HandleError': cannot access private enum declared in class 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(30): note: see declaration of 'GDCubismMotionQueueEntryHandle::HandleError'
src\gd_cubism_motion_entry.hpp(26): note: see declaration of 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(59): error C2248: 'GDCubismMotionQueueEntryHandle::HandleError': cannot access private enum declared in class 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(30): note: see declaration of 'GDCubismMotionQueueEntryHandle::HandleError'
src\gd_cubism_motion_entry.hpp(26): note: see declaration of 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(59): error C2248: 'GDCubismMotionQueueEntryHandle::HandleError': cannot access private enum declared in class 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(30): note: see declaration of 'GDCubismMotionQueueEntryHandle::HandleError'
src\gd_cubism_motion_entry.hpp(26): note: see declaration of 'GDCubismMotionQueueEntryHandle'
scons: *** [src\private\internal_cubism_renderer_2d.windows.template_debug.x86_64.obj] Error 2
scons: *** [src\private\internal_cubism_renderer.windows.template_debug.x86_64.obj] Error 2
src\gd_cubism_motion_entry.hpp(59): error C2248: 'GDCubismMotionQueueEntryHandle::HandleError': cannot access private enum declared in class 'GDCubismMotionQueueEntryHandle'
src\gd_cubism_motion_entry.hpp(30): note: see declaration of 'GDCubismMotionQueueEntryHandle::HandleError'
src\gd_cubism_motion_entry.hpp(26): note: see declaration of 'GDCubismMotionQueueEntryHandle'
scons: *** [src\private\internal_cubism_renderer_resource.windows.template_debug.x86_64.obj] Error 2
scons: *** [src\gd_cubism_user_model.windows.template_debug.x86_64.obj] Error 2
scons: *** [src\private\internal_cubism_user_model.windows.template_debug.x86_64.obj] Error 2
scons: *** [src\register_types.windows.template_debug.x86_64.obj] Error 2
scons: building terminated because of errors.

日本語で:

src\gd_cubism_motion_entry.hpp(59): エラー C2248: 'GDCubismMotionQueueEntryHandle::HandleError': このクラス内で宣言されたプライベートな列挙型にアクセスできません
src\gd_cubism_motion_entry.hpp(30): メモ: 'GDCubismMotionQueueEntryHandle::HandleError' の宣言を参照してください
src\gd_cubism_motion_entry.hpp(26): メモ: 'GDCubismMotionQueueEntryHandle' の宣言を参照してください
scons: *** [src\gd_cubism_effect.windows.template_debug.x86_64.obj] エラー 2
src\gd_cubism_motion_entry.hpp(59): エラー C2248: 'GDCubismMotionQueueEntryHandle::HandleError': このクラス内で宣言されたプライベートな列挙型にアクセスできません
src\gd_cubism_motion_entry.hpp(30): メモ: 'GDCubismMotionQueueEntryHandle::HandleError' の宣言を参照してください

僕が基本的パイソンのプログラマーなので、C++のこと全然分かりません。

ちなみに「thirdparty」のフォルダーの内容はこれです:

image

追加:日本語がちょっとだけ勉強したけど、ちょっと変な日本語を喋ったらすいません!

MizunagiKB commented 6 months ago

@albertkun Thank you for reporting the issue.

Upon investigation, I found that the build failure was due to an issue in my source code.

Specifically, the problem occurred because I did not explicitly specify an access modifier within the following source code snippet:

src/gd_cubism_motion_entry.hpp

class GDCubismMotionQueueEntryHandle : public Resource {
    GDCLASS(GDCubismMotionQueueEntryHandle, Resource)
    friend GDCubismUserModel;

    enum HandleError {
        OK = godot::Error::OK,
        FAILED = godot::Error::FAILED
    };

The correct version should be as follows:

class GDCubismMotionQueueEntryHandle : public Resource {
    GDCLASS(GDCubismMotionQueueEntryHandle, Resource)
    friend GDCubismUserModel;

public:
    enum HandleError {
        OK = godot::Error::OK,
        FAILED = godot::Error::FAILED
    };

I have already fixed this issue, and it is resolved in the latest version, which is 0.5.2. You can obtain it from the following link:

About C++ Access Modifiers

In C++, access modifiers allow you to specify the visibility level of class members (functions or variables). Here are the three main access modifiers:

In this case, the HandleError enum type within the GDCubismMotionQueueEntryHandle class was inadvertently set to private due to the missing access modifier. By addressing this issue, we can prevent potential compilation problems for others in the future.

Your report is greatly appreciated. Thank you!

MizunagiKB commented 6 months ago

This is the Japanese version of the English text posted one level above.

不具合の報告ありがとうございます。 調べたところ、ビルドが成功しない原因は私のソースコードに問題がありました。

具体的には、以下のソースコード内においてアクセス修飾子を明示的に指定していないためにコンパイルエラーが発生する環境が生じるというものでした。

src/gd_cubism_motion_entry.hpp

class GDCubismMotionQueueEntryHandle : public Resource {
    GDCLASS(GDCubismMotionQueueEntryHandle, Resource)
    friend GDCubismUserModel;

    enum HandleError {
        OK = godot::Error::OK,
        FAILED = godot::Error::FAILED
    };

正しくは以下のようになります。

class GDCubismMotionQueueEntryHandle : public Resource {
    GDCLASS(GDCubismMotionQueueEntryHandle, Resource)
    friend GDCubismUserModel;

public:
    enum HandleError {
        OK = godot::Error::OK,
        FAILED = godot::Error::FAILED
    };

こちらは既に修正していますので、最新のバージョンである、0.5.2を取得していただく事で解消致します。

C++のアクセス修飾子について

C++にはアクセス修飾子というのがあり、クラスが保持する関数や変数について公開レベルを指定することが出来るようになっています。

今回は GDCubismMotionQueueEntryHandle というクラス内の HandleError という enum 型に対してアクセス修飾子が無指定だったために private となってしまっていました。

私の環境ではmacOSでもWindowsでもビルドが通ってしまうため、この問題に気がつくことが出来ませんでした。 あなたに報告していたいだことで、将来コンパイルできずに困ってしまう方を減らすことが出来ました。

あなたの報告に感謝致します。ありがとう!

albertkun commented 6 months ago

僕のバッグレポートが役に立って、よかったです!そして、早めにバッグが見つけて直ってくれてありがとうございます!そして、詳しく説明してありがとう!!英語と日本語の説明がとても便利です!今がビルド成功したなので、確認しました!

image

感謝します!!!🙇 🙇 以上の問題なしだから、このレポート閉めます! 🎆