# Error when add new class from editor

**URL:** <https://forums.unrealengine.com/t/error-when-add-new-class-from-editor/70895>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [August 7, 2016, 7:55pm UTC](https://forums.unrealengine.com/t/error-when-add-new-class-from-editor/70895 "2016-08-07T19:55:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CyberKatana](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CyberKatana](https://forums.unrealengine.com/u/CyberKatana)\
**Post date:** [August 7, 2016, 7:55pm UTC](https://forums.unrealengine.com/t/error-when-add-new-class-from-editor/70895/1 "2016-08-07T19:55:54Z")

</div>

When i try add new class i get error

```auto

Running C:/Program Files (x86)/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="C:/Users/CyberKatana/Documents/Work/Royale/RoyaleShooter.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
LogHotReload: Recompiling module RoyaleShooter...
LogVSAccessor:Warning: Couldn't access Visual Studio
Recompiling RoyaleShooter...
Launching UnrealBuildTool... [C:/Program Files (x86)/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe RoyaleShooter -ModuleWithSuffix RoyaleShooter 6251 Win64 Development -editorrecompile -FailIfGeneratedCodeChanges -canskiplink "C:/Users/CyberKatana/Documents/Work/Royale/RoyaleShooter.uproject" -2015]
Creating makefile for hot reloading RoyaleShooter (no existing makefile)
Compiling game modules for hot reload
Performing full C++ include scan (no include cache file)
Parsing headers for RoyaleShooterEditor
  Running UnrealHeaderTool "C:\Users\CyberKatana\Documents\Work\Royale\RoyaleShooter.uproject" "C:\Users\CyberKatana\Documents\Work\Royale\Intermediate\Build\Win64\RoyaleShooterEditor\Development\RoyaleShooterEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed -FailIfGeneratedCodeChanges
ERROR: 'C:/Users/CyberKatana/Documents/Work/Royale/Intermediate/Build/Win64/UE4Editor/Inc/RoyaleShooter/MyBlueprintFunctionLibrary.generated.h': Changes to generated code are not allowed - conflicts written to 'C:/Users/CyberKatana/Documents/Work/Royale/Intermediate/Build/Win64/UE4Editor/Inc/RoyaleShooter/MyBlueprintFunctionLibrary.generated.h.conflict'
Error: Failed to generate code for RoyaleShooterEditor - error code: OtherCompilationError (5)
UnrealHeaderTool failed for target 'RoyaleShooterEditor' (platform: Win64, module info: C:\Users\CyberKatana\Documents\Work\Royale\Intermediate\Build\Win64\RoyaleShooterEditor\Development\RoyaleShooterEditor.uhtmanifest).
CompilerResultsLog: New page: Compilation - Aug 8, 2016, 1:32:55 AM
CompilerResultsLog: Info Creating makefile for hot reloading RoyaleShooter (no existing makefile)
CompilerResultsLog: Info Compiling game modules for hot reload
CompilerResultsLog: Info Performing full C++ include scan (no include cache file)
CompilerResultsLog: Info Parsing headers for RoyaleShooterEditor
CompilerResultsLog: Info Running UnrealHeaderTool "C:\Users\CyberKatana\Documents\Work\Royale\RoyaleShooter.uproject" "C:\Users\CyberKatana\Documents\Work\Royale\Intermediate\Build\Win64\RoyaleShooterEditor\Development\RoyaleShooterEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed -F
ailIfGeneratedCodeChanges
CompilerResultsLog: Info ERROR: 'C:/Users/CyberKatana/Documents/Work/Royale/Intermediate/Build/Win64/UE4Editor/Inc/RoyaleShooter/MyBlueprintFunctionLibrary.generated.h': Changes to generated code are not allowed - conflicts written to 'C:/Users/CyberKatana/Documents/Work/Royale/Intermediate/Build/Win64/UE4Editor/Inc/RoyaleShooter/MyBlueprintFunctionLibrary.g
enerated.h.conflict'
CompilerResultsLog:Error: Error Error: Failed to generate code for RoyaleShooterEditor - error code: OtherCompilationError (5) 
CompilerResultsLog: Info UnrealHeaderTool failed for target 'RoyaleShooterEditor' (platform: Win64, module info: C:\Users\CyberKatana\Documents\Work\Royale\Intermediate\Build\Win64\RoyaleShooterEditor\Development\RoyaleShooterEditor.uhtmanifest).
LogMainFrame: MainFrame: Module compiling took 6.462 seconds

```

After that i deleted folders: Binaries, Intermediate, Saved.  
And removed files of new class .h/.cpp from Source  
Then RMB-\>Generate VS project files.  
At last i run editor and tried again add new class and got same log

What im doing wrong?

---

<div class="post-metadata">

**Author:** ![Shockwave-peter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shockwave-peter](https://forums.unrealengine.com/u/Shockwave-peter)\
**Post date:** [August 8, 2016, 1:15pm UTC](https://forums.unrealengine.com/t/error-when-add-new-class-from-editor/70895/2 "2016-08-08T13:15:38Z")

</div>

All the required info is in the output:  
**Changes to generated code are not allowed** -\> MyBlueprintFunctionLibrary.generated.h

---

<div class="post-metadata">

**Author:** ![mmortall](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mmortall](https://forums.unrealengine.com/u/mmortall)\
**Post date:** [February 10, 2017, 6:37pm UTC](https://forums.unrealengine.com/t/error-when-add-new-class-from-editor/70895/3 "2017-02-10T18:37:29Z")

</div>

Sorry for undigging post but there are really no answers in the internet about this problem. I had the same problem and I want to write the solution.

This problem is related to some version control systems or engine itself. Sometimes for unknown reason or while crashing of CVS or Unreal itself the whole Project directory could be marked as Read Only. And this lead to this error.  
So you need just to remove this mark from the project directory and for subfolders.

---

<div class="post-metadata">

**Author:** ![01Lizard10](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@01Lizard10](https://forums.unrealengine.com/u/01Lizard10)\
**Post date:** [February 27, 2020, 4:44pm UTC](https://forums.unrealengine.com/t/error-when-add-new-class-from-editor/70895/4 "2020-02-27T16:44:53Z")

</div>

I had the same problem. Found a nice workaround in this video: [https://youtu.be/TgJh4XpdOxU](https://youtu.be/TgJh4XpdOxU)  
Is in German, but you can understand the importent parts.
