MSB3073 (....) exited with code 1

Everything was ok. And then out of nowhere, this pop up:

1>------ Rebuild All started: Project: RPG, Configuration: DebugGame_Editor x64 ------
1>  Cleaning RPGEditor Binaries...
1>  Parsing headers for RPGEditor
1>EXEC : error : Failed to generate code for RPGEditor
1>EXEC : error : UnrealHeaderTool failed for target 'RPGEditor' (platform: Win64, module info: D:\Unreal\RPG\Intermediate\Build\Win64\RPGEditor\DebugGame\UnrealHeaderTool.manifest).
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets(43,5): error MSB3073: The command ""D:\Unreal\Unreal Engine\4.0\Engine\Build\BatchFiles\Rebuild.bat" RPGEditor Win64 DebugGame "D:\Unreal\RPG\RPG.uproject" -rocket" exited with code 1.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Does anyone had similar issue ?
Been googling for a while about it, but there seems as many solutions to the problem, as there are project setups.

I guess it somehow paths related, but wish I know where it even start looking.

edit:
I tried building from console and Unreal Header Tool Crashed.

Are there any log files for UHT that would help diagnose problem ?

edit2:
I found the issue, though it doesn’t bring me closer to solve it. I though it might be looped depdency in header files, but it doesn’t seem the case.

In my RPGCharacter.h I have:

#include "GameFramework/SpringArmComponent.h"
#include "Common/RPGCharacterAttributes.h"
#include "Common/RPGCharacterStructs.h"
//#include "Components/RPGEquipmentManagerComponent.h"
//#include "Powers/RPGPowerBase.h"
#include "RPGCharacter.generated.h"

When I Comment this line:

 //#include "Components/RPGEquipmentManagerComponent.h"

It’s working fine (aside from unresolved member variables, that I need from this file).

When I uncomment it UHT crashes.

These are headers from component in question:

#pragma once
//#include "RPG.h"
//#include "RPGCharacter.h"
#include "../Items/RPGWeaponBase.h"
#include "../Items/RPGItem.h"
#include "RPGEquipmentManagerComponent.generated.h"

Character class is commented so it shouldn’t be problem.

Hm It seem like adding:

#include "RPG.h"

To component solved the issue. though I have no idea why it helped. I leave it open, so someone who know, might explain it. It might help with preventing further errors like that.

I meeting this exact same problem and I can’t find a solution.

I have a Character and PlayerController class. In my PlayerController class I have an include for my custom Character class. If I try to include my PlayerController incldue in my Character class header, I get the same error.

I’m also thinking about a looping dependency. I tried using an #ifndef/#define/#endif, but it doesn’t compile (compiler says an error about my #endif).

You have run into cyclic dependency. You can’t include Character.h in PlayerController.h and then PlayerController.h in Character.h

Ideally you should just include Class.generated.h and YourModuleName.h in your header.

If you are missing classes, you should just use Forward Declaration like:

class YourClassName;

And CPP files you can include whatever, and you should never run into cyclic dependency.

Hope it helps!

Ha nice !
I didn’t know about forward declaration. Looks like I still have a lot things to learn about C++. :slight_smile:
Thanks, it looks like it solved my problem.