I am having compilation troubles with with my blueprint function library class. It keeps giving me Z_Param_value errors as shown below and I have read I can’t actually change the constructor if something inherits UObject. I referenced this page A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums
for its constructor, and earlier had a UAchievementFile() constructor below the GENERATED_UCLASS_BODY(). The compilation errors I get are below.
// .h file
UCLASS()
class PROTOTYPE_API UAchievementFile : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
public:
// functions for use
UFUNCTION(BlueprintCallable, Category = "File", meta = (Keywords = "AchievementUnlocked"))
static void AchievementUnlocked(Achievements value);
UFUNCTION(BlueprintCallable, Category = "File", meta = (Keywords = "AchievementMissed"))
static void AchievementMissed(Achievements value);
UFUNCTION(BlueprintCallable, Category = "File", meta = (Keywords = "UpdateAchievementList"))
static void UpdateAchievementList();
private :
//
static UDataTable* Achievements;
static FString AchievementFile;
static FString CurrentRunFile;
static const FString EnumToString(const TCHAR* Enum, int32 EnumValue);
};
// .cpp important part
UAchievementFile::UAchievementFile(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
AchievementFile = "SummerBear\\Remote\\repo\\Prototype\\Achievementlist.txt";
CurrentRunFile = "SummerBear\\Remote\\repo\\Prototype\\CurrentAchievements.txt";
ConstructorHelpers::FObjectFinder<UDataTable> Achievements_BP(TEXT("Remote\\repo\\Prototype\\Content\\Data\\Achiements.uasset"));
Achievements = Achievements_BP.Object;
//FExcelData* RowLookUp = ExcelTable->FindRow<FDGExcellData>(TEXT("Enemy1"), TEXT("LookUp Operation"));
}
Log:
Info Compiling game modules for hot reload
Info Parsing headers for PrototypeEditor
Info Running UnrealHeaderTool "C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Prototype.uproject" "C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Intermediate\Build\Win64\PrototypeEditor\Development\PrototypeEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Info Reflection code generated for PrototypeEditor in 12.4849113 seconds
Info Performing 4 actions (2 in parallel)
Info Prototype.generated.cpp
Info AchievementFile.cpp
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.h(42) : error C2146: syntax error: missing ';' before identifier 'Z_Param_value'c:\users\owner\desktop\summerbear\remote\repo\prototype\source\prototype\AchievementFile.h(42): error C2146: syntax error: missing ';' before identifier 'Z_Param_value'
Info
Error c:\users\owner\desktop\summerbear\remote\repo\prototype\source\prototype\AchievementFile.h(42) : error C2065: 'Z_Param_value': undeclared identifier
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.h(42) : error C2065: 'Z_Param_value': undeclared identifierc:\users\owner\desktop\summerbear\remote\repo\prototype\source\prototype\AchievementFile.h(42): error C2143: syntax error: missing ';' before 'constant'
Info
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.h(42) : error C2143: syntax error: missing ';' before 'constant'
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.cpp(7) : error C2143: syntax error: missing ')' before '('
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.cpp(7) : error C2206: 'UAchievementFile::{ctor}': typedef cannot be used for function definition
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.cpp(7) : error C2059: syntax error: '&'
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.cpp(7) : error C2059: syntax error: ')'
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.cpp(8) : error C2065: 'PCIP': undeclared identifier
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.cpp(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Source\Prototype\AchievementFile.cpp(9) : error C2448: 'Super': function-style initializer appears to be a function definition
Info ERROR: UBT ERROR: Failed to produce item: C:\Users\Owner\Desktop\SummerBear\Remote\repo\Prototype\Binaries\Win64\UE4Editor-Prototype-7881.dll
Info Total build time: 101.99 seconds (Local executor: 0.00 seconds)