In file included from /src/ActionRoguelike/Intermediate/Build/Mac/x86_64/ActionRoguelikeEditor/Development/Engine/SharedPCH.Engine.ShadowErrors.h:284:
In file included from /Users/Shared/Epic Games/UE_4.27/Engine/Source/Runtime/Engine/Public/EngineSharedPCH.h:572:
0>/Users/Shared/Epic Games/UE_4.27/Engine/Source/Runtime/Engine/Classes/Materials/Material.h:272:2: Error : C++ requires a type specifier for all declarations
GENERATED_USTRUCT_BODY()
^
0>/Users/Shared/Epic Games/UE_4.27/Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectMacros.h:630:37: Reference : expanded from macro 'GENERATED_USTRUCT_BODY'
#define GENERATED_USTRUCT_BODY(...) GENERATED_BODY()
I’m getting that same error. All my c++ projects are broken and it will fail to compile any c++ project. Blueprint projects however work… But that’s not good enough. Freakin LayerNames
If anyone is still trying to figure this out I have been trying to fix this a little over the past few weeks and yesterday I spent a few hours trying to figure it out until me in my coder-rage state decided to add the lines in the screenshot to “Material.h” in the Xcode files of the Ue4 engine.
Originally the constant was named “ScrewXcode,” but I changed it because I didn’t want my app to run into some Xcode loving developer checking my code and risk insulting them. This instantly fixed my problem and I am using Xcode 13.4.1 and Unreal Engine 4.27.2
(HOPEFULLY) HOW TO FIX:
Find “Material.h” (File path is "Engine(Was shown for me outside of my project, above it in the sidebar)>UE4>Source>Runtime>Engine>Classes>Materials>Material.h(For me it was the top file in the Materials folder)
Screenshot of where Engine folder is:
Once you find Material.h, go to line 1279, that’s where the error was for me, but if that’s not where it is for you, go to the error. Then make a new line right below the line with “const TArray* LayerNames = &LayersExpression->GetLayerNames();” and add something like this to that new line below LayerNames. Example: “const TArray* XcodeAreYouHappyNow = LayerNames;”
Also Xcode might ask you to unlock “Material.h,” unlock it so you can edit it.
Hopefully this solves the problem for anyone who is still struggling.