Cant create c++ scripts in unreal engne 5

An error occurred while trying to generate project files.

Running C:/UE_5.1/Engine/Build/BatchFiles/Build.bat -projectfiles -project=“C:/Users/GComp.ge/Desktop/MyProject/MyProject.uproject” -game -rocket -progress
Running UnrealBuildTool: dotnet “…..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -projectfiles -project=“C:/Users/GComp.ge/Desktop/MyProject/MyProject.uproject” -game -rocket -progress
Log file: C:\Users\GComp.ge\AppData\Local\UnrealBuildTool\Log_GPF.txt

Some Platforms were skipped due to invalid SDK setup: IOS, Android, Linux, LinuxArm64.
See the log file for detailed information

Discovering modules, targets and source code for project…
Binding IntelliSense data…
Binding IntelliSense data… 100%
Writing project files…
Writing project files… 0%
Unhandled exception: System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.
at System.Text.StringBuilder.ToString()
at UnrealBuildTool.VCProjectFile.WriteProjectFile(List1 InPlatforms, List1 InConfigurations, PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudio\VCProject.cs:line 1381
at UnrealBuildTool.ProjectFileGenerator.WriteProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 2812
at UnrealBuildTool.VCProjectFileGenerator.WriteProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudio\VCProjectFileGenerator.cs:line 480
at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 1176
at UnrealBuildTool.GenerateProjectFilesMode.Execute(CommandLineArguments Arguments, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 233
at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 648

i have this error.

Hi @NasPeruS

It seems you may have too little system memory available to compile.

How much ram do you have? Is your page file big enough and sufficient hard drive space for the page file? Close any unneeded programs and background apps and maybe try again.

This error indicates that there is an issue with generating project files in Unreal Engine due to memory allocation. Get some more RAM at least 64 GB if you are working with super high-resolution Texture and Meshes.

What is the total Size Project Files?

I have 32 gb ram

im creating new project and cant create c++ script

|Processor|AMD Ryzen 9 5900X 12-Core Processor 3.70 GHz|
|Installed RAM|32.0 GB|

i have this specifications and have enough disk space too

Definatley should be ok but i have found this may be a DotNet issue so check out this thread:

“System.OutOfMemoryException was thrown” adding c++ classes or generating visual studio project files ( UE 5.1 ) - Programming & Scripting / C++ - Epic Developer Community Forums (unrealengine.com)

Also if the actual solution doesnt work, scroll further as there is extra info from others

Thank you very much its fixed. Dont know why but its working :smiley: