When I try to compile my code within Unreal, it fails. However, when I look in the log, it shows no cause of the failure. There are no errors whatsoever, everything is marked as info. Here are the last few lines of the log:
CompilerResultsLog: Info Reflection code generated for ColonizeEditor in 5.6058421 seconds
CompilerResultsLog: Info @progress 'Generating code...' 67%
CompilerResultsLog: Info @progress 'Generating code...' 100%
CompilerResultsLog: Info @progress pop
CompilerResultsLog: Info @progress 'Compiling C++ source files...' 0%
CompilerResultsLog: Info Performing 2 actions (12 in parallel)
CompilerResultsLog: Info @progress 'Compiling C++ source code...' 0%
CompilerResultsLog: Info [1/2] Compile GameDirector.cpp
CompilerResultsLog: Info @progress 'Compiling C++ source code...' 33%
CompilerResultsLog: Info @progress 'Compiling C++ source code...' 67%
CompilerResultsLog: Info -------- End Detailed Actions Stats -----------------------------------------------------------
CompilerResultsLog: Info ERROR: UBT ERROR: Failed to produce item: /home/[username]/Documents/Unreal Projects/Colonize/Binaries/Linux/libUE4Editor-Colonize-1909.so
CompilerResultsLog: Info Total build time: 9.45 seconds
LogMainFrame: MainFrame: Module compiling took 9.735 seconds
Warning: HotReload failed, recompile failed
It announces that it has failed, but gives no reason why. I can fix this nonexistent error by commenting out a line of code in a very basic actor class. Here is the code for it:
//==========GameDirector.h==========
#pragma once
#include "GameFramework/Actor.h"
#include "Landscape.h"
#include "Materials/MaterialInstance.h"
#include "GameDirector.generated.h"
UCLASS()
class COLONIZE_API AGameDirector : public AActor
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere)
ALandscape* terrain;
UPROPERTY(EditAnywhere)
UMaterialInstance* tMat;
// Sets default values for this actor's properties
AGameDirector();
// Called when the game starts or when spawned
virtual void BeginPlay() override;
// Called every frame
virtual void Tick( float DeltaSeconds ) override;
};
//=========GameDirector.cpp==========
#include "Colonize.h"
#include "GameDirector.h"
#include "Materials/MaterialInstance.h"
// Sets default values
AGameDirector::AGameDirector()
{
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AGameDirector::BeginPlay()
{
Super::BeginPlay();
tMat->setScalarParameterValue("GridOverlayOpacity", 1.0); //<<<< This is the line that is causing problems. By commenting it out, it compiles just fine.
}
// Called every frame
void AGameDirector::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
}
As you can see, it is primarily template code. By commenting out the line mentioned above, the compile will run just fine. What could be causing this problem?
P.S. I am using a Linux version of the editor compiled from GitHub. I am using the KDevelop IDE, so I cannot compile it from the IDE.
Update: the compile log shows no errors whatsoever. I tried inserting gibberish into one of the classes. The compile fails, but does not show an error regarding the gibberish code.