# Cant create c++ scripts in unreal engne 5

**URL:** <https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [April 21, 2023, 4:17am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376 "2023-04-21T04:17:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NasPeruS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NasPeruS](https://forums.unrealengine.com/u/NasPeruS)\
**Post date:** [April 21, 2023, 4:17am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376/1 "2023-04-21T04:17:40Z")

</div>

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(List`1 InPlatforms, List`1 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.

---

<div class="post-metadata">

**Author:** ![High500](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/high500/32/906557_2.png) [@High500](https://forums.unrealengine.com/u/High500)\
**Post date:** [April 21, 2023, 6:12am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376/2 "2023-04-21T06:12:36Z")

</div>

> [@NasPeruS](#):
>
> System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.

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.

---

<div class="post-metadata">

**Author:** ![Aadeshrao](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aadeshrao/32/920716_2.png) [@Aadeshrao](https://forums.unrealengine.com/u/Aadeshrao)\
**Post date:** [April 21, 2023, 6:25am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376/3 "2023-04-21T06:25:13Z")

</div>

> [@NasPeruS](#):
>
> Unhandled exception: System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.

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?

---

<div class="post-metadata">

**Author:** ![NasPeruS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NasPeruS](https://forums.unrealengine.com/u/NasPeruS)\
**Post date:** [April 21, 2023, 10:04am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376/4 "2023-04-21T10:04:11Z")

</div>

I have 32 gb ram

---

<div class="post-metadata">

**Author:** ![NasPeruS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NasPeruS](https://forums.unrealengine.com/u/NasPeruS)\
**Post date:** [April 21, 2023, 10:38am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376/5 "2023-04-21T10:38:15Z")

</div>

im creating new project and cant create c++ script

---

<div class="post-metadata">

**Author:** ![NasPeruS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NasPeruS](https://forums.unrealengine.com/u/NasPeruS)\
**Post date:** [April 21, 2023, 10:40am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376/6 "2023-04-21T10:40:24Z")

</div>

|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

---

<div class="post-metadata">

**Author:** ![High500](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/high500/32/906557_2.png) [@High500](https://forums.unrealengine.com/u/High500)\
**Post date:** [April 21, 2023, 10:51am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376/7 "2023-04-21T10:51:11Z")

</div>

> [@NasPeruS](#):
>
> |Processor|AMD Ryzen 9 5900X 12-Core Processor 3.70 GHz|  
> |Installed RAM|32.0 GB|

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)](https://forums.unrealengine.com/t/system-outofmemoryexception-was-thrown-adding-c-classes-or-generating-visual-studio-project-files-ue-5-1/722613)

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

---

<div class="post-metadata">

**Author:** ![NasPeruS](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NasPeruS](https://forums.unrealengine.com/u/NasPeruS)\
**Post date:** [April 21, 2023, 10:56am UTC](https://forums.unrealengine.com/t/cant-create-c-scripts-in-unreal-engne-5/1135376/8 "2023-04-21T10:56:11Z")

</div>

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