UPROPERTY: OtherCompilationError (5)

Hello, I try to get my two variable (NumLang and TestSetUp) into my blueprint. But when i use UPROPRETY, my compilation fail.

Error 1: Severity Code Description Project File Line Suppression State
Error MSB3075 The command ““D:\Programme File\Epic Game\Epic Games\4.13\Engine\Build\BatchFiles\Build.bat” TheUniverseEditor Win64 Development “G:*****************.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command. ****** C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets 41

Error 2: Severity Code Description Project File Line Suppression State
Error code OtherCompilationError (5)

My code :

#pragma once

#include "Section_1/GameSetUp.h"

#include "GameFramework/Pawn.h"
#include "TestPawnBis.generated.h"

UCLASS()
class THEUNIVERSE_API ATestPawnBis : public APawn
{
	GENERATED_BODY()

public:
	// Sets default values for this pawn's properties
	ATestPawnBis();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
	

	UPROPERTY(BlueprintReadWrite, Category = "Test")
		int NumLang = 0;

	UPROPERTY(BlueprintReadWrite, Category = "Test")
		GameSetUp TestSetUp;

};

maybe with more log we can help you ? (usually errors in my projects are written some lines before error 5)

I have juste this two Error

When remove this :

UPROPERTY(BlueprintReadWrite, Category = "Test")
		int NumLang = 0;

UPROPERTY(BlueprintReadWrite, Category = "Test")
		GameSetUp TestSetUp;

That work

Look in output tab, error list is very buggy with UBT

Hey Carl,

That error message is a very general one, and more often than not, its because of syntax.

Remember that Unreal C++ is not exactly the same as C++. In Unreal, int has to be written as int32.

 UPROPERTY(BlueprintReadWrite, Category = "Test")
         int32 NumLang = 0;

As Mookiez said, you probably need to set your “int” as “int32”
I’m also guessing that “GameSetUp” is a class you’ve defined, in which case you’ll need to include the “*” to make your variable a pointer rather than a direct assignment:

UPROPERTY(BlueprintReadWrite, Category = "Test")
GameSetUp* TestSetUp;

But I’ve seen this error a few times with my project, and it’s usually not actually a problem with VS or my code; rather, it’s a Windows permissions error. Just shut down VS and reopen your project. Try your build again and you’ll likely have no problems.

Or, at least, different problems. :wink:

I’ve tried with int32 and that work but for my class :

UPROPERTY(BlueprintReadWrite, Category = "Test")
		GameSetUp* TestSetUp;

It didn’t work. I’ve tried some other thing, like :

UPROPERTY(BlueprintReadWrite, Category = "Test")
		class GameSetUp* TestSetUp;

UPROPERTY(BlueprintReadWrite, Category = "Test")
		TSubclassOf<class GameSetUp> TestSetUp;

UPROPERTY(BlueprintReadWrite, Category = "Test")
		TSubclassOf<class GameSetUp*> TestSetUp;

But that never work.

You shouldn’t need the “class” marker, and TSubclassOf would be used for a delayed load of the object. The proper format for that would be:

TSubclassOf<GameSetUp>

But now that I think of it, you should have a prefix on your classname. Is this an actor or an object? If it’s an actor, your class is probably called “AGameSetUp”, if it’s a uobject it’ll be “UGameSetUp”.

So your variable declaration should be:

UPROPERTY(BlueprintReadWrite, Category = "Test")
AGameSetUp* TestSetUp;

OR:

UPROPERTY(BlueprintReadWrite, Category = "Test")
UGameSetUp* TestSetUp;

What is GameSetUp? An Actor? A UObject? A struct?

If it’s a class, how is it declared in GameSetUp.h ?

If you’re getting new/different errors on your build, please post the content of the Output tab after the build. The Visual Studio errors tab can be misleading because UE4 uses so many macros and has its own structure.