Circular Dependency in a Data Table

Hello,

Some many weeks ago I made a data table. I got it in game and it works great. Now since yesterday, I can’t launch my game, it fails to load at 71%. I am trying to rebuild the game, but I am getting an error on the build. Which did not happen last night, I was working with Steamworks features, rather than data tables. And it did compile, but failed to package the game, then I relaunch the editor, and it failed to launch. And now I can’t compile.

The full output log

1>------ Build started: Project: ShaderCompileWorker, Configuration: Development_Program x64 ------
1>  Target is up to date
2>------ Build started: Project: MusicalRange, Configuration: Development_Editor x64 ------
2>  Parsing headers for MusicalRangeEditor
2>    Running UnrealHeaderTool "D:\Dropbox\MusicalRange-4.14\MusicalRange.uproject" "D:\Dropbox\MusicalRange-4.14\Intermediate\Build\Win64\MusicalRangeEditor\Development\MusicalRangeEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors
2>LogCompile : error : Circular dependency detected for filename D:\Dropbox\MusicalRange-4.14\Source\MusicalRange\NoteColorDataTable.h!
2>  Reflection code generated for MusicalRangeEditor in 107.0226092 seconds
2>  Performing 3 actions (4 in parallel)
2>  MusicalRange.generated.cpp
2>  NoteColorDataTable.cpp
2>  [3/3] Link UE4Editor-MusicalRange.dll
2>     Creating library D:\Dropbox\MusicalRange-4.14\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MusicalRange.lib and object D:\Dropbox\MusicalRange-4.14\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MusicalRange.exp
2>  Total build time: 509.56 seconds
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command "D:\UnrealEngine\UnrealEngine4-14\Engine\Build\BatchFiles\Build.bat MusicalRangeEditor Win64 Development "D:\Dropbox\MusicalRange-4.14\MusicalRange.uproject" -waitmutex" exited with code -1.
========== Build: 1 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

Then, the Header file for NoteColorDataTable

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "MusicalRange.h"
#include "Engine/DataTable.h"
#include "NoteColorDataTable.h"
#include "NoteColorDataTable.generated.h"

/** Structure that defines a level up table entry */
USTRUCT(BlueprintType)
struct FNoteColorDataTable : public FTableRowBase
{
	GENERATED_USTRUCT_BODY()

public:
	/*
	FNoteColorDataTable()
	: NoteNumber(0)
	, Red(0)
	, Green(0)
	, Blue(0)
	, Alpha(255)
	{}*/

	/** Note Number associated to a color */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Musical Range")
		int32 NoteNumber;

	/** Red value from 0 - 255 */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Musical Range")
		uint8 Red;

	/** Green value from 0 - 255 */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Musical Range")
		uint8 Green;

	/** Blue value from 0 - 255 */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Musical Range")
		uint8 Blue;

	/** Alpha value from 0 - 255, should always be 255 */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Musical Range")
		uint8 Alpha;

	/** Constructors They do nothing*/
	FNoteColorDataTable();
	~FNoteColorDataTable();
};

And the CPP File, which doesn’t do anything.

// Fill out your copyright notice in the Description page of Project Settings.

#include "MusicalRange.h"
#include "NoteColorDataTable.h"
#include "Engine/DataTable.h"


FNoteColorDataTable::FNoteColorDataTable()
{
}

FNoteColorDataTable::~FNoteColorDataTable()
{
}

So, I don’t know why the build is failing all of a sudden. Maybe is issues with Dropbox Syncing, but it compiled fine yesterday on hot reload from the editor.

You’re including NoteColorDataTable.h inside NoteColorDataTable.h… that won’t end well, and is what UHT is warning about.

Ha! I was too frustrated to think clearly!