I’ve had this problem since I started my project in UE5 5.3, but I was able to avoid it by typing “…/” in front of includes that are not in main “Source” folder.
But now, when I have more “complex” folder structure (Source/folder/folder2) I realized that this “…/” approach is not the best option here, especially when I didnt experience such problem in UE4.
So thats how things look in my project:
- I dont have “public”"private" folders, header and .cpp files are in the same folder (I’m just more comfortable this way).
- I dont have problems with including .generated.h, engine or plugin headers.
- Problem occures only with my headers inside my project.
What i’ve tried and it didnt help (and possiblly make it worse):
- Remove Intermediate, .vs and Saved folders and then re-generate VS project files via unreal .uproject file.
- re-generate VS project files via unreal .uproject file without removing folders.
- Add “${SolutionDir}/MyProject/Source” path to “MyPorject->Properties->VC++ Directories → Include Directories”
3rd part is the most insteresting, I didnt found any include path to my solutions dir / project’s “Source” folder dir in default project properties! So I decided to insert new line in Include Directories.
If I try to re-generate VS files via .uproject then it will delete my change in project’s property. (But it’s not a big deal I think, because it’s not working anyway)
What I’m certain about:
- Files that I’m trying to include are certainly there
- There is no mistake in include path
Compiler error itself:
fatal error C1083: Cannot open include file: ‘Events/EventActors/YAirBomb.h’: No such file or directory