MSB3073 Compile Error

I have created a simple Blueprint Function Library in C++ but even with my minimal code it is throwing errors.

Here are the two errors.

Error code OtherCompilationError (5) MyProject C:\Users\ZheGames\Documents\Unreal Projects\MyProject\Intermediate\ProjectFiles\Error 1

Error MSB3073 The command ““C:\Program Files (x86)\Epic Games\4.10\Engine\Build\BatchFiles\Build.bat” MyProjectEditor Win64 Development “C:\Users\ZheGames\Documents\Unreal Projects\MyProject\MyProject.uproject” -rocket -waitmutex -2015” exited with code -1. MyProject C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 37

and here is the code that is causing them.

SortIntegerArray.h

#pragma once

#include "Kismet/BlueprintFunctionLibrary.h"
#include "SortIntegerArray.generated.h"

/**
 * 
 */
UCLASS()
class MYPROJECT_API USortIntegerArray : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintCallable)
	static void SortArray();
};

SortIntegerArray.cpp

#include "MyProject.h"
#include "SortIntegerArray.h"

void USortIntegerArray::SortArray()
{

}

I can’t seem to find anyone else with this problem online. The MSB3073 error for them is usually caused by something else in the code, but for me the error only goes away when I remove the

public:
	UFUNCTION(BlueprintCallable)
	static void SortArray();

from the .h file and the

void USortIntegerArray::SortArray()
{

}

from the .cpp file.