Hi,
I have created a BlueprintFuntionLibraray which works fine in 4.8.3 and versions below. Converting the project to 4.9.2 gives me an error. Somebody got an idea? Thank you for helping.
Code of the lib:
MyBlueprintFunctionLibrary.h
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyBlueprintFunctionLibrary.generated.h"
/**
*
*/
UCLASS()
class PROJ_MANSION_UNREAL_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_UCLASS_BODY()
UFUNCTION(BlueprintCallable, Category = "save")
static bool FileSaveString(FString SaveTextB, FString FileNameB);
UFUNCTION(BlueprintPure, Category = "save")
static bool FileLoadString(FString FileNameA, FString& SaveTextA);
};
MyBlueprintFunctionLibrary.cpp
#include "proj_mansion_unreal.h"
#include "MyBlueprintFunctionLibrary.h"
UMyBlueprintFunctionLibrary::UMyBlueprintFunctionLibrary(const class FPostConstructInitializeProperties & PCIP)
: Super(PCIP)
{
}
bool UMyBlueprintFunctionLibrary::FileSaveString(FString SaveTextB, FString FileNameB)
{
return FFileHelper::SaveStringToFile(SaveTextB, *(FPaths::GameDir() + FileNameB));
}
bool UMyBlueprintFunctionLibrary::FileLoadString(FString FileNameA, FString& SaveTextA)
{
return FFileHelper::LoadFileToString(SaveTextA, *(FPaths::GameDir() + FileNameA));
}
And the error Message:
Running C:/Program Files/Epic Games/4.9/Engine/Binaries/DotNET/UnrealBuildTool.exe proj_mansion_unreal Development Win64 -project="C:/_projects/proj_mansion_unreal 4.9/proj_mansion_unreal.uproject" -rocket -editorrecompile -progress -noubtmakefiles
@progress push 5%
Parsing headers for proj_mansion_unrealEditor
Running UnrealHeaderTool "C:/_projects/proj_mansion_unreal 4.9/proj_mansion_unreal.uproject" "C:\_projects\proj_mansion_unreal 4.9\Intermediate\Build\Win64\proj_mansion_unrealEditor\Development\UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -rocket -installed
Reflection code generated for proj_mansion_unrealEditor in 5,8283368 seconds
@progress pop
Performing 7 actions (4 in parallel)
[2/7] Resource ModuleVersionResource.rc.inl
[3/7] Resource proj_mansion_unreal.rc
PCH.proj_mansion_unreal.h.cpp
proj_mansion_unreal.generated.cpp
MyBlueprintFunctionLibrary.cpp
proj_mansion_unreal.cpp
C:\_projects\proj_mansion_unreal 4.9\Source\proj_mansion_unreal\MyBlueprintFunctionLibrary.cpp(7) : error C2059: syntax error : 'string'
C:\_projects\proj_mansion_unreal 4.9\Source\proj_mansion_unreal\MyBlueprintFunctionLibrary.cpp(7) : error C2143: syntax error : missing ',' before '&'
C:\_projects\proj_mansion_unreal 4.9\Source\proj_mansion_unreal\MyBlueprintFunctionLibrary.cpp(7) : error C2059: syntax error : '&'
C:\_projects\proj_mansion_unreal 4.9\Source\proj_mansion_unreal\MyBlueprintFunctionLibrary.cpp(8) : error C2511: 'UMyBlueprintFunctionLibrary::UMyBlueprintFunctionLibrary(const FObjectInitializer (__cdecl *)(void))' : overloaded member function not found in 'UMyBlueprintFunctionLibrary'
c:\_projects\proj_mansion_unreal 4.9\source\proj_mansion_unreal\MyBlueprintFunctionLibrary.h(12) : see declaration of 'UMyBlueprintFunctionLibrary'
C:\_projects\proj_mansion_unreal 4.9\Source\proj_mansion_unreal\MyBlueprintFunctionLibrary.cpp(8) : error C2065: 'PCIP' : undeclared identifier
C:\_projects\proj_mansion_unreal 4.9\Source\proj_mansion_unreal\MyBlueprintFunctionLibrary.cpp(9) : error C2550: 'UMyBlueprintFunctionLibrary::{ctor}' : constructor initializer lists are only allowed on constructor definitions
-------- End Detailed Actions Stats -----------------------------------------------------------
ERROR: UBT ERROR: Failed to produce item: C:\_projects\proj_mansion_unreal 4.9\Binaries\Win64\UE4Editor-proj_mansion_unreal.dll
Total build time: 28,89 seconds