Upon creating a new “third person” project I am hit with this error message:
An error occurred while trying to generate project files.
Running C:/Program Files/Epic Games/UE_5.1/Engine/Build/BatchFiles/Build.bat -projectfiles -project=“C:/Users/name/OneDrive/Documents/Unreal Projects/MyProject3/MyProject3.uproject” -game -rocket -progress
Running UnrealBuildTool: dotnet “…..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -projectfiles -project=“C:/Users/name/OneDrive/Documents/Unreal Projects/MyProject3/MyProject3.uproject” -game -rocket -progress
‘dotnet’ is not recognized as an internal or external command,
operable program or batch file.
I installed .NET, but I still get an error message when trying to create a new C++ class:
Successfully added class ‘MyCharacter1’, however you must recompile the ‘MyProject4’ module before it will appear in the Content Browser. Failed to generate project files.
Would you like to open the Output Log to see more details?
How do I recompile? I hate to sound like an idiot, but I’m very new to this.
No problem, if you are new to C++ it can be a little hard at the very beginings.
First, as @Bojann said, make sure that you have installed .NET sources. Second, its very important that you have installed these 3 developper (Sorry for spanish)
Once you done installed it , you want to double click in your .uproject file and select “Generate Visual Studio project files” and wait until the new .sln file is created. Open it and, press Ctrl+Shift+B to build that source code. It now should work
Try going to your project folder, and deleting the folders Binaries, Intermediate, and Saved. and then, right click in your .uproject file and select “Generate Visual Studio project files” and see how it works
Ah yes, I know this issue. Happens to me all the time.
Close your UE Editor
Open your MyCharacter1.cpp file in the IDE you use (if you are not using Rider, consider doing so).
At the top, you will probably see that import is messed up. It will be something like: #include "Some_path/MyCharacter1.h", remove Some_path if your .h and .cpp files are in the same directory, and compile should start working.
If they are in a different directory, just make sure you use proper directory tree in the include. And all should start working for you.
Please give us the screenshot of the file tree where CPP and H file are located if you are unable to resolve it. And give us the proper log stack so that we can help.