Right in that case, something’s seriously messed up with your project. I can tell you for a fact that EngineMinimal.h includes Kismet/GameplayStatics.h.
In your project can you verify that:
The file that throws up the gameplay statics error is referencing .h
has a #include for “Engine.h” or “EngineMinimal.h”
You don’t have any other errors (like missing include - sorry but I’ve got to ask)
Additionally, do you want to double click UGameplayStatics to hilight, then press Ctrl+F12? Just to check it’s actually taking you to the definition. Just to check your include directories aren’t messed up and the engine is definitely there.
Dude - as stated, you need to include the precompiled header file. You need to put #include projectname.h at the top of the cpp. Additionally it’s Engine not core you need if you want a single, monolithic header file that brings in GameplayStatics.
Maybe I’ve misread your code, but as far as I can see you haven’t incorporated these changes as advised.
Put the PCH include at the top of the CPP
In the PCH header include Engine.h or EngineMinimal.h
Mate just go with me on this. If you need me to spell it out, I mean the first include after the header file, as the error tells you.
Where did you get this idea that it’s not a good idea to include a PCH? Including a PCH decreases build times, sometimes by a factor of minutes. Regardless, think about concentrating on optimising compilation times after you have your build working. You should be including the PCH from every single definition file (and if you don’t you will have to include things again and again.)
This the de facto way of working not only in UE4 but in any C++ project on a commercial team. It will also fix your problem!
I’m terribly sorry if I’ve come across as aggressive Gunschlinger, that was not the intention at all; I’m simply trying to emphasise the point that you’ve been misinformed. You asked why you need to include every single file, the answer is technically you don’t - include PCH, Engine.h in your PCH. Nachtmahr also offered an helpful alternative perspective on the challenge.