when i create a C++ project in UE5.3 but I create a project it gives me this error message

WindowsTargetRules.Compiler to VisualStudio2019. The current compiler version was detected as: 14.29.30152

Error Message

Running F:/Program Files/Epic Games/UE_5.3/Engine/Build/BatchFiles/Build.bat  -projectfiles -project="F:/Download/Game/CppFuncToBluePrint/CppFuncToBluePrint4/CppFuncToBluePrint4.uproject" -game -rocket -progress
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -projectfiles -project="F:/Download/Game/CppFuncToBluePrint/CppFuncToBluePrint4/CppFuncToBluePrint4.uproject" -game -rocket -progress
Log file: C:\Users\abcd\AppData\Local\UnrealBuildTool\Log_GPF.txt

Generating VisualStudio project files:
Discovering modules, targets and source code for project...
Microsoft platform targets must be compiled with Visual Studio 2022 17.4 (MSVC 14.34.x) or later for the installed engine. Please update Visual Studio 2022 and ensure no configuration is forcing WindowsTargetRules.Compiler to VisualStudio2019. The current compiler version was detected as: 14.29.30152

日本語 メッセージ

F:/Program Files/Epic Games/UE_5.3/Engine/Build/BatchFiles/Build.bat -projectfiles -project="F:/Download/Game/CppFuncToBluePrint/CppFuncToBluePrint4/CppFuncToBluePrint4.uproject" -game -rocket -progress を実行します。
バンドルされている DotNet SDK バージョンの使用: 6.0.302
UnrealBuildTool の実行: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" -projectfiles -project="F:/Download/Game/CppFuncToBluePrint/CppFuncToBluePrint4/CppFuncToBluePrint4.uproject" -game -rocket -progress
ログ ファイル: C:\Users\abcd\AppData\Local\UnrealBuildTool\Log_GPF.txt

VisualStudio プロジェクト ファイルの生成:
プロジェクトのモジュール、ターゲット、ソース コードを検出しています...
Microsoft プラットフォーム ターゲットは、インストールされているエンジンに対して Visual Studio 2022 17.4 (MSVC 14.34.x) 以降でコンパイルする必要があります。 Visual Studio 2022 を更新し、WindowsTargetRules.Compiler を VisualStudio2019 に強制する構成がないことを確認してください。 現在のコンパイラのバージョンは 14.29.30152 として検出されました。

直し方はVisual Studio Installer で個別のコンポーネントタブからMSVC のなかから14.29.30152のチェックを外すこと

参考

https://forums.unrealengine.com/t/help-when-i-create-a-c-project-in-ue5-3-but-i-create-a-project-it-gives-me-this-error-message/1305945

[UnrealEngine]C++ シンプルなクラス構文

クラスの定義はヘッダファイルで行います。

#include <string>
using namespace std;
class Class1
{
// 
private:
	string name; //メンバ変数
// 
public:
	void print1(); //メンバ関数のプロトタイプ宣言
	void print2(); //メンバ関数のプロトタイプ宣言
// 
};

cppでのメソッドの実装

void クラス::実装するメソッド名()

#include "Class1.h"
#include <iostream>
using namespace std;

// 
void Class1::print1()
{
	name = "print1";
	cout << name << "が処理されました\n";

	return;
}
// 
void Class1::print2()
{
	name = "print2";
	cout << name << "が処理されました。どうしてニンニク味のガムってないんだろう?\n";

	return;
}

クラスからインスタンスを生成して利用するサンプルです。

Class1 *インスタンス名 = new Class1();

インスタンス名 – > 使用するメソッド名();

#include "Class1.h"

int main() {

	Class1 *cla2 = new Class1();
	cla2->print1(); //print1が処理されました
	cla2->print2(); //print2が処理されました
	delete cla2;

	return 0;
}