ゲームプログラミングC++の14章に出てくる動かないサンプルソースを動かすためのメモ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

なので3つの設定をやってしまった。

ーーーーーーーーーーーーーーーーーーーーーー

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

Build EventのPostを

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y



AudioSystem.cpp(59,11)をコメントして
//mSystem->getLowLevelSystem(&mLowLevelSystem);

SoundEvent.cpp(83,10)をコメントして
//event->setParameterValue(name.c_str(), value);

SoundEvent.cpp(126,10)をコメントして
//event->getParameterValue(name.c_str(), &retVal);

できたー

ゲームプログラミングC++の13章に出てくる動かないサンプルソースを動かすためのメモ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

なので3つの設定をやってしまった。

ーーーーーーーーーーーーーーーーーーーーーー

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

Build EventのPostを

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y



AudioSystem.cpp(59,11)をコメントして
//mSystem->getLowLevelSystem(&mLowLevelSystem);

SoundEvent.cpp(83,10)をコメントして
//event->setParameterValue(name.c_str(), value);

SoundEvent.cpp(126,10)をコメントして
//event->getParameterValue(name.c_str(), &retVal);

できたー

ゲームプログラミングC++の12章に出てくる動かないサンプルソースを動かすためのメモ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

なので3つの設定をやってしまった。

ーーーーーーーーーーーーーーーーーーーーーー

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

Build EventのPostを

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

にした。

AudioSystem.cpp(59,11)をコメントして
//mSystem->getLowLevelSystem(&mLowLevelSystem);

SoundEvent.cpp(83,10)をコメントして
//event->setParameterValue(name.c_str(), value);

SoundEvent.cpp(126,10)をコメントして
//event->getParameterValue(name.c_str(), &retVal);

できたー

ゲームプログラミングC++の11章に出てくる動かないサンプルソースを動かすためのメモ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

なので3つの設定をやってしまった。

ーーーーーーーーーーーーーーーーーーーーーー

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

Build EventのPostを

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

にした。

AudioSystem.cpp(59,11)をコメントして
//mSystem->getLowLevelSystem(&mLowLevelSystem);

SoundEvent.cpp(83,10)をコメントして
//event->setParameterValue(name.c_str(), value);

SoundEvent.cpp(126,10)をコメントして
//event->getParameterValue(name.c_str(), &retVal);

できたー

ゲームプログラミングC++の10章に出てくる動かないサンプルソースを動かすためのメモ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

なので3つの設定をやってしまった。

ーーーーーーーーーーーーーーーーーーーーーー

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー

Build EventのPreを

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

あとはコメント化して無効化の修正

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\AudioSystem.cpp(59,11): error C2039: ‘getLowLevelSystem’: is not a member of ‘FMOD::Studio::System’
//mSystem->getLowLevelSystem(&mLowLevelSystem);にコメントして無効化

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\SoundEvent.cpp(83,10): error C2039: ‘setParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
//event->setParameterValue(name.c_str(), value);にコメントして無効化


1>D:\Sandbox\gameprogcpp_code\code-master\Chapter10\SoundEvent.cpp(126,10): error C2039: ‘getParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
//event->getParameterValue(name.c_str(), &retVal);にコメントして無効化

できたー

ゲームプログラミングC++の9章に出てくる動かないサンプルソースを動かすためのメモ

基本7章と同じ

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter09\SoundEvent.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp’: No such file or directory

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter09\AudioSystem.cpp(59,11): error C2039: ‘getLowLevelSystem’: is not a member of ‘FMOD::Studio::System’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(36,11):
//mSystem->getLowLevelSystem(&mLowLevelSystem);//コメントアウト

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter09\SoundEvent.cpp(83,10): error C2039: ‘setParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> see declaration of ‘FMOD::Studio::EventInstance’
//event->setParameterValue(name.c_str(), value);//コメントアウト

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter09\SoundEvent.cpp(126,10): error C2039: ‘getParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> see declaration of ‘FMOD::Studio::EventInstance’
//event->getParameterValue(name.c_str(), &retVal);//コメントアウト

で解決して次のエラー

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command “xcopy “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\..\external\SDL\lib\win\x86*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\..\external\GLEW\lib\win\x86*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\lowlevel\lib*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073:
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd” exited with code 4.

対処手順:
1,Visual Studioを管理者として実行します。
2,プロジェクトのプロパティを開き、ビルド設定でDLLファイルのコピーが正しく行われているか確認します。
3、ターゲットディレクトリのアクセス許可を確認し、必要に応じて変更します。
4,DLLファイルのパスが正しいか確認します。
5,FMOD Studio APIが正しくインストールされているか確認します。
上記を確認後、再度ビルドを実行します。

fmodL.dll が見つからないため、コードの実行を続行できません。プログラムを
再インストールすると、この問題が解決する可能性があります。

元はこうだった

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\lowlevel\lib\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\*.dll" "$(OutDir)" /i /s /y

直して

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

こうした

できたー

ゲームプログラミングC++の7章に出てくる動かないサンプルソースを動かすためのメモ

7章のslnは

こうゆうエラーを吐く

1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\AudioSystem.cpp(11,10): error C1083: Cannot open include file: ‘fmod_studio.hpp‘: No such file or directory

1>D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio_common.h(14,10): error C1083: Cannot open include file: ‘fmod.h‘: No such file or directory
1>(compiling source file ‘AudioSystem.cpp’)

fmodを使うので

ユーザー登録をしてダウンロードしてくる 今回はDドライブにインストールした。
https://www.fmod.com/download

Visual Studioの場合:
Gameプロジェクトを右クリックし、[プロパティ]を選択。
[C/C++] → [追加のインクルードディレクトリ] を選び、FMODのインクルードフォルダのパス
(例:
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\inc
)を追加。
変更後、プロジェクトを再ビルドしてみてください。


英語
1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\SoundEvent.cpp(83,10): error C2039: ‘setParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> see declaration of ‘FMOD::Studio::EventInstance’
1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\SoundEvent.cpp(126,10): error C2039: ‘getParameterValue’: is not a member of ‘FMOD::Studio::EventInstance’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> see declaration of ‘FMOD::Studio::EventInstance’


日本語
1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\SoundEvent.cpp(83,10): エラー C2039: ‘setParameterValue’: は ‘FMOD::Studio::EventInstance’ のメンバーではありません
83行をコメントアウト
//event->setParameterValue(name.c_str(), value);

1>D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> ‘FMOD::Studio::EventInstance’ の宣言を参照してください
1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\SoundEvent.cpp(126,10): エラー C2039: ‘getParameterValue‘: は ‘FMOD::Studio::EventInstance’ のメンバーではありません
127行をコメントアウト
//event->getParameterValue(name.c_str(), &retVal);

1>D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(184,11):
1> ‘FMOD::Studio::EventInstance’ の宣言を参照してください


1>D:\Sandbox\gameprogcpp_code\code-master\Chapter07\AudioSystem.cpp(59,11): error C2039: ‘getLowLevelSystem‘: is not a member of ‘FMOD::Studio::System’
1> D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\inc\fmod_studio.hpp(36,11):
1> see declaration of ‘FMOD::Studio::System’
AudioSystem.cpp(59,11)をコメントアウト
//mSystem->getLowLevelSystem(&mLowLevelSystem);

1>LINK : fatal error LNK1104: cannot open file ‘fmodL_vc.lib’
1>LINK : fatal error LNK1104: cannot open file ‘fmodstudioL_vc.lib’
[リンカー] → [追加の依存ファイル]にFMODのライブラリを追加します。
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86
D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86

1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command “xcopy “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\..\external\SDL\lib\win\x86*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\..\external\GLEW\lib\win\x86*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\lowlevel\lib*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: xcopy “C:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib*.dll” “D:\Sandbox\gameprogcpp_code\code-master\Chapter07\Debug\” /i /s /y
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073:
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd” exited with code 4.

対処手順:
1,Visual Studioを管理者として実行します。
2,プロジェクトのプロパティを開き、ビルド設定でDLLファイルのコピーが正しく行われているか確認します。
3、ターゲットディレクトリのアクセス許可を確認し、必要に応じて変更します。
4,DLLファイルのパスが正しいか確認します。
5,FMOD Studio APIが正しくインストールされているか確認します。
上記を確認後、再度ビルドを実行します。

fmodL.dll が見つからないため、コードの実行を続行できません。プログラムを
再インストールすると、この問題が解決する可能性があります。

元はこうだったが

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\lowlevel\lib\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\*.dll" "$(OutDir)" /i /s /y

を直して

xcopy "$(ProjectDir)\..\external\SDL\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "$(ProjectDir)\..\external\GLEW\lib\win\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\lib\x86\*.dll" "$(OutDir)" /i /s /y
xcopy "D:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\studio\lib\x86\*.dll" "$(OutDir)" /i /s /y

にした

起動した!!

[UE5.3.2]エラー: UnrealBuildTool.dll が「….\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll」に見つかりません NuGetパッケージマネージャーは使っちゃダメです!環境壊れます!!!

Windows 11 Pro
UnrealEngine 5.3.2
Visual Studio 2022

今回はぱっとUE5.3.2で作ったC++プロジェクトをzipで別PCに移動したときにおこった。

Using bundled DotNet SDK version: 6.0.302 ERROR: UnrealBuildTool.dll not found in “….\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll”

ERROR: UnrealBuildTool.dll not found in "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll"

発生した問題は、『Generate Visual Studio Project Files』を実行した際に画像のようなダイアログが発生し、『エディタも起動しない』『VisualStudioも起動しない』状態になり、困りました。

C++プロジェクトをビルドするのに必要なチェックが入っていなかった。

動いた

コードのカラーも大丈夫そう

UE5をClean
ProjectをCleanして

Build Solutionしてみた。

========== Build: 11 succeeded, 36 failed, 0 up-to-date, 1 skipped ==========

NuGetが・・・・・・

画像に alt 属性が指定されていません。ファイル名: image-22-1024x668.png

NuGetパッケージマネージャーは安易な気持ちで使っちゃダメです!UE環境壊れます!!!ここから下は参考にするだけにしてください。

AI による概要

詳細

このソリューションに脆弱性のあるNuGetパッケージが含まれているとのことですね。NuGetパッケージの管理には、以下の手順があります。

  1. 1. 脆弱性のあるパッケージの確認:Visual StudioのNuGetパッケージマネージャーまたはパッケージマネージャーコンソールで、脆弱性の可能性があるパッケージを特定します。
  2. 2. パッケージのアップデートまたは削除:削除しちゃだめ!!!!!!!!アップデート
    • アップデート:脆弱性のあるパッケージの最新バージョンが公開されている場合は、それをインストールします。>だめ!!
    • 削除:脆弱性のあるパッケージが不要な場合は、ソリューションから削除します。
  3. 3. ソリューションのビルドとテスト:パッケージの更新または削除後、ソリューションをビルドし、テストして、問題がないことを確認します。

まとめ
• .csprojファイルがなくても問題ありません。
• C++コードの編集・ビルドはそのまま進めてOKです。
• C#ツールのエラーは無視しても大丈夫なことが多いです。
もし「C++コードのビルドや実行で困っていること」があれば、
その具体的なエラーや現象を教えてください。
それに合わせて、さらに詳しくサポートします。

UE53_ThirdPersonCpp.uproject をダブルクリックしたが起動した

HLSLをつかったプロジェクトも大丈夫そうだ。

消し過ぎたので

OpenTracing をUnrealBuildToolをターゲットに再インストールした。

入った

 をUnrealBuildToolをターゲットに再インストールした。
• EpicGames.OIDC や EpicGames.Core などの .NET プロジェクトで、
• OpenTracing
• IdentityModel
• Microsoft.Extensions.*
などの名前空間が見つからないエラーが出ています。

IdentityModelをEpicgames.Core,Epicgames.IODC, UnrealBuildToolをターゲットに再インストールした。

Microsoft.Extensions.ConfigurationをEpicgames.Core,Epicgames.IODC, UnrealBuildToolをターゲットに再インストールした。

Microsoft.Extensions.Options を全ターゲットに再インストールした。

Microsoft.Extensions.DependencyInjection を全ターゲットに再インストールした。

• Microsoft.Extensions.Logging を全ターゲットに再インストールした。

• Microsoft.Extensions.Primitives を全ターゲットに再インストールした。

Solution Clean とSolution Build してみた。だめぽい

  1. .NETプロジェクトのNuGet依存関係エラー
    • OpenTracing.Contrib.NetCore 0.9.0 は Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0 && < 7.0.0) を要求していますが、9.0.5 がインストールされています。
    • そのため、多くの .NET プロジェクトがビルド失敗しています。
    対応策
    • すべての .NET プロジェクトで Microsoft.Extensions.DependencyInjection.Abstractions のバージョンを 6.0.x にダウングレードしてください。

• 他の Microsoft.Extensions.* 系パッケージも 6.0.x に揃えると安全です。

  1. Unreal Engine C++ プロジェクトのビルドエラー
    • System.UnauthorizedAccessException: Access to the path … is denied.
    → ファイルアクセス権限エラーです。
    対応策
    • 該当ファイル(例: SharedDefinitions.Engine.Cpp20.h)や Intermediate/Build ディレクトリに書き込み権限があるか確認してください。
    Visual StudioやEpic Games Launcherを「管理者として実行」してみてください。

• 他のプロセス(例: ウイルス対策ソフトやエクスプローラー)が該当ファイルをロックしていないか確認してください。

まとめ
• .NET系のエラーは「依存パッケージのバージョン不整合」なので、バージョンを6.0.xに揃えることで解消します。

• C++側のエラーは「ファイルアクセス権限」なので、管理者権限やファイルロックの解除で解消します。

Unreal EngineのC++プロジェクト自体は、.NETのNuGet依存エラーがあってもビルドできる場合がありますが、

.NETツールやAutomationToolが必要な場合は、依存エラーを解消しないと正常動作しません。

• OpenTracing.Contrib.NetCore 0.6.2 をEpicgames.Core,Epicgames.IODC, UnrealBuildToolをターゲットに再インストールした。

治らないのでEpic +VS系を全部アンインストールしてインストールすることになりました。

それでNuGet前まで来てやっと治ります。これで正常。

========== Build: 11 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 14:42 and took 01:48.725 minutes ==========


自動的に起動した。

やっと回復した。

[visualstudio][cpp][UE5]UE5 Logic Nightで話題になったイベントディスパッチャーとデリゲートに関する調べものvol.03アニメーション終了時にイベント起こす

エンジンソース的には

D:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Engine\Classes\Animation\AnimInstance.h

// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
//中略
#include "Animation/AnimSubsystemInstance.h"
#include "Animation/AnimSync.h"
#include "Animation/AnimNotifies/AnimNotify.h"
#include "AnimInstance.generated.h"

// Post Compile Validation requires WITH_EDITOR
#define ANIMINST_PostCompileValidation WITH_EDITOR

struct FDisplayDebugManager;
class FDebugDisplayInfo;
class IAnimClassInterface;
class UAnimInstance;
//中略
struct FSmartNameMapping;
struct FAnimNode_LinkedAnimLayer;
struct FNodeDebugData;
enum class ETransitionRequestQueueMode : uint8;
enum class ETransitionRequestOverwriteMode : uint8;
class UAnimMontage;

typedef TArray<FTransform> FTransformArrayA2;

namespace UE::Anim
{
	struct FHeapAttributeContainer;
	using FSlotInertializationRequest = TPair<float, const UBlendProfile*>;
	struct FCurveFilterSettings;
}	// namespace UE::Anim

//中略
//デリゲートのパラメータもらうやつ
DECLARE_DELEGATE_OneParam(FOnMontageStarted, UAnimMontage*)
DECLARE_DELEGATE_TwoParams(FOnMontageEnded, UAnimMontage*, bool /*bInterrupted*/)
DECLARE_DELEGATE_TwoParams(FOnMontageBlendingOutStarted, UAnimMontage*, bool /*bInterrupted*/)
/**
* Delegate for when Montage がスタートした時
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMontageStartedMCDelegate, UAnimMontage*, Montage);

/**
* Delegate for when Montage が再生 completedの時,  中断されたかinterrupted or 終了したかfinished
* このモンタージュの重みは 0.f なので、出力ポーズへの寄与は停止します
*
* プロパティが完了していない場合は bInterrupted = true
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnMontageEndedMCDelegate, UAnimMontage*, Montage, bool, bInterrupted);

/**すべてのモンタージュインスタンスが終了したときに委任します。 */
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnAllMontageInstancesEndedMCDelegate);

/**
モンタージュがブレンドアウトを開始したタイミング(中断または終了)のデリゲート
* このモンタージュの DesiredWeight は 0.f になりますが、これは出力ポーズに引き続き影響します
*
* プロパティが終了していない場合は bInterrupted = true
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnMontageBlendingOutStartedMCDelegate, UAnimMontage*, Montage, bool, bInterrupted);

/** ネイティブコードがフックして追加の遷移ロジックを提供できるデリゲート */
DECLARE_DELEGATE_RetVal(bool, FCanTakeTransition);

/** ネイティブコードがフックして状態の開始/終了を処理できるデリゲート */
DECLARE_DELEGATE_ThreeParams(FOnGraphStateChanged, const struct FAnimNode_StateMachine& /*Machine*/, int32 /*PrevStateIndex*/, int32 /*NextStateIndex*/);

/** ユーザーがカスタムアニメーションカーブ値を挿入できるようにするデリゲート - 今のところは単一のみです。これを複数のデリゲートにして値を順番に取得する方法はわかりません。 */
DECLARE_DELEGATE_OneParam(FOnAddCustomAnimationCurves, UAnimInstance*)

/** 「PlayMontageNotify」および「PlayMontageNotifyWindow」によって呼び出されるデリゲート **/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FPlayMontageAnimNotifyDelegate, FName, NotifyName, const FBranchingPointNotifyPayload&, BranchingPointPayload);


//中略

/** Helper struct to store a Queued Montage BlendingOut event. */
struct FQueuedMontageBlendingOutEvent
{
	TObjectPtr<class UAnimMontage> Montage;
	bool bInterrupted;
	FOnMontageBlendingOutStarted Delegate;

	FQueuedMontageBlendingOutEvent()
		: bInterrupted(false)
	{}

	FQueuedMontageBlendingOutEvent(class UAnimMontage* InMontage, bool InbInterrupted, FOnMontageBlendingOutStarted InDelegate)
		: Montage(InMontage)
		, bInterrupted(InbInterrupted)
		, Delegate(InDelegate)
	{}
};

/** 以下長すぎるので省略 */

	UPROPERTY(BlueprintAssignable)
	FOnMontageStartedMCDelegate OnMontageStarted;

	/** Called when a montage has ended, whether interrupted or finished*/
	UPROPERTY(BlueprintAssignable)
	FOnMontageEndedMCDelegate OnMontageEnded;

デリゲートするとき統一の呪文のパラメータもらうやつ

DECLARE_DELEGATE_OneParam(FOnMontageStarted, UAnimMontage) DECLARE_DELEGATE_TwoParams(FOnMontageEnded, UAnimMontage, bool /bInterrupted/)
DECLARE_DELEGATE_TwoParams(FOnMontageBlendingOutStarted, UAnimMontage, bool /bInterrupted*/)

Montage が再生 completedの時, 中断されたかinterrupted or 終了したかfinished

  • モンタージュが中断または終了したときに委任する
  • このモンタージュの重みは 0.f なので、出力ポーズへの寄与は停止します
  • プロパティが完了していない場合は bInterrupted = true
    / DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnMontageEndedMCDelegate, UAnimMontage, Montage, bool, bInterrupted);

D:\Program Files\Epic Games\UE_5.3\Engine\Source\Runtime\Engine\Private\Animation\AnimInstance.cpp

//SET
void UAnimInstance::Montage_SetEndDelegate(FOnMontageEnded& InOnMontageEnded, UAnimMontage* Montage)
{
	if (Montage)
	{
		FAnimMontageInstance* MontageInstance = GetActiveInstanceForMontage(Montage);
		if (MontageInstance)
		{
			MontageInstance->OnMontageEnded = InOnMontageEnded;
		}
	}
	else
	{
		// If no Montage reference, do it on all active ones.
		for (int32 InstanceIndex = 0; InstanceIndex < MontageInstances.Num(); InstanceIndex++)
		{
			FAnimMontageInstance* MontageInstance = MontageInstances[InstanceIndex];
			if (MontageInstance && MontageInstance->IsActive())
			{
				MontageInstance->OnMontageEnded = InOnMontageEnded;
			}
		}
	}
}


//GET
FOnMontageEnded* UAnimInstance::Montage_GetEndedDelegate(UAnimMontage* Montage)
{
	if (Montage)
	{
		FAnimMontageInstance* MontageInstance = GetActiveInstanceForMontage(Montage);
		if (MontageInstance)
		{
			return &MontageInstance->OnMontageEnded;
		}
	}
	else
	{
		// If no Montage reference, use first active one found.
		for (int32 InstanceIndex = 0; InstanceIndex < MontageInstances.Num(); InstanceIndex++)
		{
			FAnimMontageInstance* MontageInstance = MontageInstances[InstanceIndex];
			if (MontageInstance && MontageInstance->IsActive())
			{
				return &MontageInstance->OnMontageEnded;
			}
		}
	}

	return nullptr;
}

Montage_SetEndDelegate関数によってSETできるデリゲート

void UAnimInstance::Montage_SetEndDelegate(FOnMontageEnded& InOnMontageEnded, UAnimMontage* Montage)

Montage_GetEndedDelegate関数によってGETできるデリゲート

FOnMontageEnded* UAnimInstance::Montage_GetEndedDelegate(UAnimMontage* Montage)

エンジンソース終わり

使い方

AnimInstanceのイベントディスパッチャーで使うと Bind Event To On Montage Endとなる。

動いた

C++サンプル

.h

// ヘッダー内の関数宣言
void OnAnimationEnded(UAnimMontage* Montage, bool bInterrupted);

.cpp

// 実装内 
// デリゲート FOnMontageEnded型のEndDelegate を宣言 
FOnMontageEnded EndDelegate;
// バインド 
EndDelegate.BindUObject(this, &UMyClass::OnAnimationEnded); 
// 設定 
MyAnimInstance->Montage_SetEndDelegate(EndDelegate);

参考URL

AnimInstance->OnMontageEnd に関数をバインドするにはどうすればよい

https://forums.unrealengine.com/t/how-can-i-bind-a-function-to-animinstance-onmontageend/290717/2

[visualstudio][cpp][UE5]UE5 Logic Nightで話題になったイベントディスパッチャーとデリゲートに関する調べものvol.02エンジンソースで見つけたUnrealEngine C++のデリゲート Oculus の例

.h

D:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Online\OnlineSubsystemOculus\Source\Classes\OculusFindSessionsCallbackProxy.h

ヘッダーでデリゲート変数の型指定してる

FOnFindSessionsCompleteDelegate Delegate; これがデリゲート変数の型指定

ヘッダーでデリゲートハンドルの型指定してる。

//登録された OnFindSessionsComplete デリゲートへのハンドル
FDelegateHandle DelegateHandle;

というのは・・・・

D:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Online\OnlineSubsystem\Source\Public\Interfaces\OnlineSessionDelegates.h

でこのように定義されている

OnlineSessionDelegates.hでの FOnFindSessionsCompleteDelegate の定義

  • オンライン セッションの検索が完了したときに呼び出されるデリゲート
  • @param bWasSuccessful 非同期アクションがエラーなしで完了した場合は true、エラーがあった場合は false

    DECLARE_MULTICAST_DELEGATE_OneParam(FOnFindSessionsComplete, bool);
    typedef FOnFindSessionsComplete::FDelegate FOnFindSessionsCompleteDelegate;

.h 全文

// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "UObject/Object.h"
#include "Net/OnlineBlueprintCallProxyBase.h"
#include "Interfaces/OnlineSessionInterface.h"
#include "FindSessionsCallbackProxy.h"
#include "OculusFindSessionsCallbackProxy.generated.h"

/**
 * Exposes FindSession of the Platform SDK for blueprint use.
 */
UCLASS(MinimalAPI)
class UOculusFindSessionsCallbackProxy : public UOnlineBlueprintCallProxyBase
{
	GENERATED_UCLASS_BODY()

	// Called when there is a successful query
	UPROPERTY(BlueprintAssignable)
	FBlueprintFindSessionsResultDelegate OnSuccess;

	// Called when there is an unsuccessful query
	UPROPERTY(BlueprintAssignable)
	FBlueprintFindSessionsResultDelegate OnFailure;

	// Searches for matchmaking room sessions with the oculus online subsystem
	UFUNCTION(BlueprintCallable, Category = "Oculus|Session", meta = (BlueprintInternalUseOnly = "true"))
	static UOculusFindSessionsCallbackProxy* FindMatchmakingSessions(int32 MaxResults, FString OculusMatchmakingPool);

	// Searches for moderated room sessions with the oculus online subsystem
	UFUNCTION(BlueprintCallable, Category = "Oculus|Session", meta = (BlueprintInternalUseOnly = "true"))
	static UOculusFindSessionsCallbackProxy* FindModeratedSessions(int32 MaxResults);

	// UOnlineBlueprintCallProxyBase interface
	virtual void Activate() override;
	// End of UOnlineBlueprintCallProxyBase interface

private:
	// Internal callback when the session search completes, calls out to the public success/failure callbacks
	void OnCompleted(bool bSuccess);

private:

	// The delegate executed by the online subsystem
	FOnFindSessionsCompleteDelegate Delegate;//デリゲート宣言

	// Handle to the registered OnFindSessionsComplete delegate
	FDelegateHandle DelegateHandle;//デリゲートハンドル宣言

	// Object to track search results
	TSharedPtr<FOnlineSessionSearch> SearchObject;

	// Maximum number of results to return
	int MaxResults;

	// Optional: if searching within a matchmaking pool
	FString OculusPool;

	bool bSearchModeratedRoomsOnly;
};

CPP

D:\Program Files\Epic Games\UE_5.3\Engine\Plugins\Online\OnlineSubsystemOculus\Source\Private\OculusFindSessionsCallbackProxy.cpp では

デリゲートにOnComplitedをバインドしてる

Super(ObjectInitializer) のあと

Delegate(FOnFindSessionsCompleteDelegate::CreateUObject(this, &ThisClass::OnCompleted))

デリゲートハンドルにDelegateを渡してる。(コールしてる)

if (OculusSessionInterface.IsValid()) のタイミングで

DelegateHandle = OculusSessionInterface->AddOnFindSessionsCompleteDelegate_Handle(Delegate);

// Copyright Epic Games, Inc. All Rights Reserved.

#include "OculusFindSessionsCallbackProxy.h"
#include "OnlineSubsystemOculusPrivate.h"
#include "Online.h"
#include "OnlineSessionInterfaceOculus.h"
#include "OnlineSubsystemOculusPrivate.h"

UOculusFindSessionsCallbackProxy::UOculusFindSessionsCallbackProxy(const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
	  , Delegate(FOnFindSessionsCompleteDelegate::CreateUObject(this, &ThisClass::OnCompleted))
	  , MaxResults(0)
	  , bSearchModeratedRoomsOnly(false)
{
//デリゲートにOnComplitedをバインド
}

UOculusFindSessionsCallbackProxy* UOculusFindSessionsCallbackProxy::FindMatchmakingSessions(int32 MaxResults, FString OculusMatchmakingPool)
{
	UOculusFindSessionsCallbackProxy* Proxy = NewObject<UOculusFindSessionsCallbackProxy>();
	Proxy->SetFlags(RF_StrongRefOnFrame);
	Proxy->MaxResults = MaxResults;
	Proxy->OculusPool = MoveTemp(OculusMatchmakingPool);
	Proxy->bSearchModeratedRoomsOnly = false;
	return Proxy;
}

UOculusFindSessionsCallbackProxy* UOculusFindSessionsCallbackProxy::FindModeratedSessions(int32 MaxResults)
{
	UOculusFindSessionsCallbackProxy* Proxy = NewObject<UOculusFindSessionsCallbackProxy>();
	Proxy->SetFlags(RF_StrongRefOnFrame);
	Proxy->MaxResults = MaxResults;
	Proxy->bSearchModeratedRoomsOnly = true;
	return Proxy;
}

void UOculusFindSessionsCallbackProxy::Activate()
{
PRAGMA_DISABLE_DEPRECATION_WARNINGS
	auto OculusSessionInterface = Online::GetSessionInterface(OCULUS_SUBSYSTEM);
PRAGMA_ENABLE_DEPRECATION_WARNINGS

	if (OculusSessionInterface.IsValid())
	{
        //デリゲートハンドルにDelegateを渡してる。(コールしてる)
		DelegateHandle = OculusSessionInterface->AddOnFindSessionsCompleteDelegate_Handle(Delegate);

		SearchObject = MakeShareable(new FOnlineSessionSearch);
		SearchObject->MaxSearchResults = MaxResults;
		SearchObject->QuerySettings.Set(SEARCH_OCULUS_MODERATED_ROOMS_ONLY, bSearchModeratedRoomsOnly, EOnlineComparisonOp::Equals);

		if (!OculusPool.IsEmpty())
		{
			SearchObject->QuerySettings.Set(SETTING_OCULUS_POOL, OculusPool, EOnlineComparisonOp::Equals);
		}

		OculusSessionInterface->FindSessions(0, SearchObject.ToSharedRef());
	}
	else
	{
		UE_LOG_ONLINE_SESSION(Error, TEXT("Oculus platform service not available. Skipping FindSessions."));
		TArray<FBlueprintSessionResult> Results;
		OnFailure.Broadcast(Results);
	}
}

void UOculusFindSessionsCallbackProxy::OnCompleted(bool bSuccess)
{
PRAGMA_DISABLE_DEPRECATION_WARNINGS
	auto OculusSessionInterface = Online::GetSessionInterface(OCULUS_SUBSYSTEM);
PRAGMA_ENABLE_DEPRECATION_WARNINGS

	if (OculusSessionInterface.IsValid())
	{
		OculusSessionInterface->ClearOnFindSessionsCompleteDelegate_Handle(DelegateHandle);
	}

	TArray<FBlueprintSessionResult> Results;

	if (bSuccess && SearchObject.IsValid())
	{
		for (auto& Result : SearchObject->SearchResults)
		{
			FBlueprintSessionResult BPResult;
			BPResult.OnlineResult = Result;
			Results.Add(BPResult);
		}

		OnSuccess.Broadcast(Results);
	}
	else
	{
		OnFailure.Broadcast(Results);
	}
}

ちょっと複雑すぎてちょと何言ってるかわからない感じもする。が

まとめ4つを同じように見つけることができた。

1、デリゲート宣言

FOnFindSessionsCompleteDelegate Delegate;

2、ハンドル初期化

FDelegateHandle DelegateHandle;

3,バインド

Delegate(FOnFindSessionsCompleteDelegate::CreateUObject(this, &ThisClass::OnCompleted))

4タイミングでコール呼び出し

DelegateHandle = OculusSessionInterface->AddOnFindSessionsCompleteDelegate_Handle(Delegate);

自信がないので間違っていたら連絡してほしいです。