LoginSignup
0
0

More than 3 years have passed since last update.

[UE4C++]BlueprintFunctionLibraryを継承したクラスでUUserWidgetクラスを参照するとビルドエラーになった時の対処

Posted at

状況

BlueprintFunctionLibraryを継承したC++クラス
関数の引数にUUserWidgetのクラスを指定したい
スクリーンショット (100).png

ビルドするとリンクエラーが出る
コード:2019
説明:未解決の外部シンボル ○○○ が関数 △△△ で参照されました
101.png

完成形

スクリーンショット (101).png

解決方法

ModuleBuild.csのPublicDependencyModuleNames.AddRangeに追加
※Moduleはクラスの公式ドキュメントに記載
※UUserWidgetのModuleは"UMG"
スクリーンショット (102).png

まとめ

私が詰まった問題なので忘れないように記事に残す。
今回の状況以外にもリンクエラーになる場合はあると思う。

余談

BlueprintFunctionLibrary以外の汎用的なクラス(Actorとか)の継承であればリンクエラーはでなかった。まぁ単純にプログラムの知識の話だと思う。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0