Hi.
My code
UBlueprint * bp = Cast<UBlueprint>(cls);
field3.FieldValue = bp->GetFriendlyName();
compiles well in UE Editor.
But this code can’t be compiled on game packaging. It gets error:
Packaging (Windows (64-bit)): UnrealBuildTool: MyGame.generated.cpp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Art\Projects\3D\MyGame\Source\MyGame\MyNativePlayerController.cpp(47) : error C2039: 'GetFriendlyName' : is not a member of 'UBlueprint'
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Engine/Blueprint.h(266) : see declaration of 'UBlueprint'
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Art\Projects\3D\MyGame\Source\MyGame\MyNativePlayerController.cpp(116) : warning C4996: 'AStaticMeshActor::StaticMeshComponent': StaticMeshComponent should not be accessed directly, please use GetStaticMeshComponent() function instead. StaticMeshComponent will soon be private and your code will not compile. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files\Epic Games\4.8\Engine\Source\Runtime\Engine\Classes\Engine/StaticMeshActor.h(23) : see declaration of 'AStaticMeshActor::StaticMeshComponent'
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: MyFurnitureActor.cpp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: MyGame.cpp
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\Art\Projects\3D\MyGame\Binaries\Win64\MyGame.exe
As I see, in Blueprint.h
virtual FString GetFriendlyName() const;
wrapped by
#if WITH_EDITOR
How can I compile this code on packaging?