Ambiguous "MSB3073" compiler error

I started a project and have successfully added a few classes without any issues, but the last class I’ve added has constantly thrown this error when attempting to compile.

2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ““C:\Program Files\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat” testEditor Win64 Development “C:\Users\Pecon\Documents\Unreal Projects\test\test.uproject” -rocket -waitmutex” exited with code -1.

Since the project compiled fine with the other classes before I added this one, I’m assuming those are fine. So if it’s a problem with my code then it’s probably this class. So I’ll post that here, it’s mostly copied from a beginner’s tutorial to the unreal framework.

chatHUD.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include “GameFramework/HUD.h”
#include “chattyHUD.generated.h”

UCLASS()

class TEST_API AchattyHUD : public AHUD
{
GENERATED_BODY()

public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = HUDFont);
UFont* HUDFont;
void DrawHUD() override;
};

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

#include "test.h"
#include "chattyHUD.h"

void AchattyHUD::DrawHUD()
{
Super::DrawHUD();

DrawLine(200, 300, 400, 500, FLinearColor::Blue);
DrawText("Hello worlds!", FVector2D(0, 0), hudFont, FVector2D(1, 1), FColor::White);
}

What’s the entire build log?

And have you tried deleting your intermediate\build folder before building?

I did this which seemed to make it ‘forget’ the generated.h file for that class which caused a bunch of other errors (Recreate VS files didn’t seem to correct it). I recreated the class again under a slightly different name and have gotten to the same scenario again.

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------

2>------ Build started: Project: test, Configuration: Development_Editor x64 ------

2> Creating makefile for hot reloading testEditor (no existing makefile)

2> Compiling game modules for hot reload

2> Parsing headers for testEditor

2> Running UnrealHeaderTool “C:\Users\Pecon\Documents\Unreal Projects\test\test.uproject” “C:\Users\Pecon\Documents\Unreal Projects\test\Intermediate\Build\Win64\testEditor\Development\UnrealHeaderTool.manifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -rocket -installed

2> C:/Users/Pecon/Documents/Unreal Projects/test/Source/test/chattyHUD.h(17) : Member variable declaration: Missing variable type

2>Error : Failed to generate code for testEditor - error code: OtherCompilationError (5)

2> UnrealHeaderTool failed for target ‘testEditor’ (platform: Win64, module info: C:\Users\Pecon\Documents\Unreal Projects\test\Intermediate\Build\Win64\testEditor\Development\UnrealHeaderTool.manifest).

2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command ““C:\Program Files\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat” testEditor Win64 Development “C:\Users\Pecon\Documents\Unreal Projects\test\test.uproject” -rocket -waitmutex” exited with code -1.

========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

On an unrelated note do you know any way to make it stop condensing all my text? Double spacing all the lines manually just to make it readable is a pain to do.

You missed an error

2> C:/Users/Pecon/Documents/Unreal Projects/test/Source/test/chattyHUD.h(17) : Member variable declaration: Missing variable type

Turns out that the issue was that I declared UFont* “HUDFont”, but ended up calling it by “hudFont” in the cpp file. I think the moral of this story is that if you’re getting an MSB3073, it means that you’ve done something (probably trivial) wrong in your code and for whatever reason the compiler just explodes instead of giving you a decent error message.