# "Generate Visual Studio Project Files" did not auto-generate generated.h header files

**URL:** <https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602>\
**Category:** C++\
**Tags:** header, unreal-engine, generate-project-fil, bug-report, UE4, CPP, question\
**Created:** [March 25, 2015, 10:16pm UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602 "2015-03-25T22:16:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![asperatology](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@asperatology](https://forums.unrealengine.com/u/asperatology)\
**Post date:** [March 25, 2015, 10:16pm UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602/1 "2015-03-25T22:16:38Z")

</div>

**Branch:** Binary, from Launcher  
**Version:** 4.7.3  
**System Specs:** Alienware 13, Nvidia Geforce 860M, Windows 8.1

![35929-no_generate_nearest.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/1/3a149640658a6286d3bc4000b6710e1cb10aaaea.gif)

While I was editing my code and building them, I got errors saying:

```
Error	1	error code: OtherCompilationError (2)	C:\Users\tom_m_000\Documents\Unreal Projects\get-debt\Intermediate\ProjectFiles\Error	GetDebt

```

And the output window says:

```
GetDebt/Objects/GetDebtWheelRear.h(16) : Expected an include at the top of the header: '#include "GetDebtWheelRear.generated.h"'

```

There is no “generated.h” header files in the project, as far as I can tell. I expected the “Generate Visual Studio Project files” option to actually generate everything, including “generated.h” header files the project needs.

But the actual result, as shown in the GIF above, shows otherwise. Hence the bug report.

**Does anyone know how to fix this issue where the “generated.h” header files are missing from the project?**

---

<div class="post-metadata">

**Author:** ![asperatology](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@asperatology](https://forums.unrealengine.com/u/asperatology)\
**Post date:** [March 25, 2015, 10:58pm UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602/2 "2015-03-25T22:58:32Z")

</div>

> Does anyone know how to fix this issue where the “generated.h” header files are missing from the project?

Ok, I answered my own question.

To fix this:

1. Open “Binaries” folder in the project root folder.
2. Delete the folder in there.
3. Re-arrange the source codes if you are re-organizing the file structures.
4. “Generate Visual Studio project files” by right-clicking the UPROJECT file and selecting the option.
5. Double click on the UPROJECT file.
6. Open Unreal Engine 4 Editor to check to make sure the instanced code classes are re-organized to the way you wanted.

It is an issue, and the feature request has been made. [Thread link here.](https://forums.unrealengine.com/showthread.php?64177-Improve-C-Source-File-Removal-Detection-in-Editor)

---

<div class="post-metadata">

**Author:** ![salkuma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@salkuma](https://forums.unrealengine.com/u/salkuma)\
**Post date:** [May 15, 2015, 1:40am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602/3 "2015-05-15T01:40:21Z")

</div>

It also works when a new module is not exposed on the editor. I had tried add a new module into my project, but I got _NewModuleHeader.generated.h.conflict_ file on _[ProjectName]\Intermediate\Build\Win64\UE4Editor\Inc[NewModuleName]_ folder. I spent a few hours to find a solution, then I followed above instruction, magic! it works. My editor showed up new modules I had added. Thanks @asperatology

---

<div class="post-metadata">

**Author:** ![Aericks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Aericks](https://forums.unrealengine.com/u/Aericks)\
**Post date:** [October 5, 2016, 5:45am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602/4 "2016-10-05T05:45:03Z")

</div>

I know that this post is fairly old, but in the future when someone (ie myself) runs into a problem at step 5 not able to open up, and therefore unable to generate code, there is another error in your code, and the compiler will NOT find it, because it will crash while searching for generated .h files.

I spent about an hour on this before realizing that I had a syntax error on the file I was previously working on before I had to generate the files.

---

<div class="post-metadata">

**Author:** ![Midsoft\_Games](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Midsoft\_Games](https://forums.unrealengine.com/u/Midsoft_Games)\
**Post date:** [July 27, 2017, 7:10pm UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602/5 "2017-07-27T19:10:56Z")

</div>

Oh, so you have deleted the folder in the Binaries for UE4 to request a rebuild. (Right?)

---

<div class="post-metadata">

**Author:** ![dazzlesoftware](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dazzlesoftware](https://forums.unrealengine.com/u/dazzlesoftware)\
**Post date:** [August 10, 2017, 12:29am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602/6 "2017-08-10T00:29:47Z")

</div>

Sometimes if you do not see any errors I find the best solution is to not rely on the unreal engine IDE but load up your c/c++ IDE like in visual studio and rebuild whole project there.

Reason being if you migrate from one version of engine to another the API often changes since the unreal engine now follow the same rule as game engine as a service.

even its labeled 4.x it will be constantly changing and even major releases where before if was following Major.Revision.Minor it would be in version 18.x by now lol

---

<div class="post-metadata">

**Author:** ![supremepandalord](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@supremepandalord](https://forums.unrealengine.com/u/supremepandalord)\
**Post date:** [May 6, 2020, 8:30am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602/7 "2020-05-06T08:30:32Z")

</div>

Hi can we open this topic up again cause I have the same problem, I regenerated the project and unreal and VS still cant find the generated.h, it’s a BTService and I keep getting the compile error: fatal error occurred : could not find BTService\_FindPlayer.h. please help

---

<div class="post-metadata">

**Author:** ![supremepandalord](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@supremepandalord](https://forums.unrealengine.com/u/supremepandalord)\
**Post date:** [May 6, 2020, 8:33am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-did-not-auto-generate-generated-h-header-files/312602/8 "2020-05-06T08:33:26Z")

</div>

Here is the code:

#pragma once

#include “CoreMinimal.h”  
#include “BehaviorTree/BTService.h”  
#include “BehaviorTree/BehaviorTreeComponent.h”  
#include “BTService\_FindPlayer.generated.h”

/\*\*  
\*  
\*/  
{  
UCLASS()  
class MyProject\_API UBTService\_FindPlayer : public UBTService;  
}  
{  
GENERATED\_BODY()  
public:  
UBTService\_FindPlayer();  
virtual void TickNode(UBehaviorTreeComponent & OwnerComp, uint8 \* NodeMemory, float DeltaSeconds) override;

};

p.s I definetly have the Ai and gameplay module in my build.cs file
