Help with migrating from 4.14 to 4.15

Then your problem isn’t the struct, it’s something else.

Any ideas how I should go about tracking this down? I have this project in 4.14 as well and it compiles fine. I only use two plugins (Runtime Mesh Component, and Unreal Fast Noise). Both of which I downloaded the new versions for the 4.15 migration. As I mentioned before if I comment out those two structs the compiler will go further before encountering an error (the error is about the structs missing). During this further compiling the compiler actually generates the generated headers located in the intermediate folder for all my header files. With the structs not commented out, it just gives me the error mentioned above. So I’m just trying to figure out how one might trouble shoot figuring out where this error is since it’s clearly related to 4.15 and not code error.

So I played with this and got it to compile using the following:




USTRUCT(BlueprintType)
struct FAry
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY()
	TArray<int32> cells;

	FAry() { }

	friend FArchive& operator<<(FArchive& Ar, FAry& V)
	{
		return Ar << V.cells;
	}
};

USTRUCT(BlueprintType)
struct F3DARY
{
	GENERATED_USTRUCT_BODY()

	F3DARY():numVerts(0) {	}

	UPROPERTY()
	TArray<FAry> row;

	UPROPERTY()
	TArray<int32> faces;

	UPROPERTY()
	int32 numVerts;

	friend FArchive& operator<<(FArchive& Ar, F3DARY& V)
	{
		return Ar << V.row << V.faces << V.numVerts;
	}
};

USTRUCT(BlueprintType)
struct F4DARY
{
	GENERATED_USTRUCT_BODY()

	F4DARY():Dummy(0) { }

	UPROPERTY()
	TArray<F3DARY> ROW;	//UP TO DOWN

	UPROPERTY()
	int32 Dummy;

	friend FArchive& operator<<(FArchive& Ar, F4DARY& V)
	{
		return Ar << V.ROW;
	}
};


UHT seems to have some issue with multiple empty default constructors defined in a header file for structs (maybe classes too). For whatever reason, using a member initializer list causes it to stop acting crazy. The only thing I can imagine that is happening is that the UHT is either failing to properly parse those struct constructors, or (more likely) just removing them since the compiler will generate them for you. But that’s just a guess, I didn’t have time to debug the UHT process step by step. I’m also not sure why the first one is completely fine by itself, but completely breaks when the other structs are added (even if they are empty/have no members).

The workaround is to either create your struct declaration in a CPP file like a normal method (leaving only the simple definition in the header file), or to use a constructor initializer list.

I could be completely off here, but this is what I found that worked for this specific case.

Wow, that was it. I don’t know how you figured that one out but thanks. This sounds like a bug with the UHT?

Seems like it. Or that configuration is somehow fixing some underlining syntax error with the macros. No idea. Didn’t get that far.