Download

Compilation errors

I am following along with the tutorial called “3rd person power up game with c++”. I believe I have copied all the code correctly because I have double checked it all over, but however I get a compilation error that reads,“Info Creating makefile for hot reloading BatteryCollector (List of files containing UHT types has changed)
Info Compiling game modules for hot reload
Info Parsing headers for BatteryCollectorEditor
Info Running UnrealHeaderTool “C:/Users/Owner/Documents/Unreal Projects/BatteryCollector/BatteryCollector.uproject” “C:\Users\Owner\Documents\Unreal Projects\BatteryCollector\Intermediate\Build\Win64\BatteryCollectorEditor\Development\UnrealHeaderTool.manifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -rocket -installed
Error C:/Users/Owner/Documents/Unreal Projects/BatteryCollector/Source/BatteryCollector/Pickup.h(26) : BlueprintReadOnly should not be used on private members
Error Error: Failed to generate code for BatteryCollectorEditor - error code: OtherCompilationError (5)
Info UnrealHeaderTool failed for target ‘BatteryCollectorEditor’ (platform: Win64, module info: C:\Users\Owner\Documents\Unreal Projects\BatteryCollector\Intermediate\Build\Win64\BatteryCollectorEditor\Development\UnrealHeaderTool.manifest).” I have checked line, 26 and at first there were a couple of misspellings, but I attended those. And yet, I still seem to get an error. I am following along in attempt to do exactly what the video requires us to do. Also how do I upload my .header and .cpp files from visual studio 2015 in this forum post? I’m more so confused on how to obtain the file from visual studio 2015 so I can bring it in here.

There’s your error message. Everything else can be ignored for now.
Whatever your code looks like, remove BlueprintReadOnly from the UPROPERTY macro for this variable. If you still want it to be accessible from Blueprint you could add a getter UFUNCTION or instead make the variable a public or protected member if possible.

That was such a simple problem to fix haha. I guess I should read these error messages the compiler gives, very literally. In this piece of code, “/** Static mesh to represent the pickup in the level */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = “Pickup”, meta = (AllowPrivateAcess = “true”))” I deleted " BlueprintReadOnly" and it compiled successfully.

You can use BlueprintReadOnly for a private member with meta = (AllowPrivateAccess = “true”).
It seems that you mispelled “AllowPrivateAccess”.