Download

cannot open source file "myheader.h"

So I am new to UE4 and C++ but not new to programming in general.

I’m trying to create a header file with a few structs to use in my game.
I right clicked my source folder → Add → New Item → Header File → Gave it a name etc…
In the file I included “Engine.h” so I could have my structs contain 'FVector’s
Now the final step would be to include it in my Game.h file or in the Character.h file (doesn’t matter which, I’ll decide later)
The problem is whenever I try to do this in either one I get:
cannot open source file “myheader.h”
What am I doing wrong?

Thanks!

PS: myheader.h is in the same folder as Game.h
PPS: I named my project Game hence why my main header is called Game.h

May be thats the problem:
VS creates new files in the Intermediate\ProjectFiles folder instead in the source folder.
Just move it from there with Windows Explorer to the correct folder or create a new one and add it in VS with Add -> Existing item.

2 Likes

<3 you (in a completely [EDIT it removed h o m o, lol] way) :smiley: