What #include in the header and .cpp files?

If anyone is still struggling… In your header files, you should have the following includes:

#include "CoreMinimal.h"      // Must be first
(...)                         // Other #includes
#include "xxxxx.generated.h" // Must be last (xxxxx is the name of the header file itself)

In “other includes”, you should include the headers that define your base class and any other class that you use as member variables.

In your cpp files:

#include "xxxxx.h"      // Must be first (xxxxx is the name of the header file for this cpp file)
(...)                   // Other #includes

In “other includes”, you should include the headers that define any other class that you use in the code, and that have not already been included in your header (it’s ok to have the same include in both files).

After rearranging the #includes, try doing a full rebuild (ctrl+alt+F7) instead of a simple build (F7).

This issue is now wasting my time , where I’am fighting the editor and engine instead of learning…,

This whole “here’s a challenge” is also breaks train of thought.

Hey mate, where did you include the #include “DrawDebugHelpers.h”??
I’ve tried in various orders in the h and cpp file, but c++/visual comes up with errors

Might be a bit late now, but I just included it in Grabber.h file. :smiley:

If you are learning unreal and not trying to figure out C++ you are dealing with the unreal editor and new structure of it. intelisense follows that. If you are trying to figure out C++ while learning the game engine then yes it is confusing with the version changes. Don’t forget you can look at his code when you get lost. The code for this is updated per section.

Privacy & Terms