This is somewhat the opposite of UE-92876. Steps:
- Select “Add C++ class” and specify a custom path (e.g. “Gameplay” for class “ItemSpecs”)
- Attempt to compile project
- Project fails to compile:
Gameplay\ItemSpecs.cpp(4): fatal error C1083: Cannot open include file: 'Gameplay/ItemSpecs.h': No such file or directory
The issue is that the auto-generated code DOES include the path but it does not seem to be found by the compiler.
Workaround: remove extra include path.
#include "Gameplay/ItemSpecs.h" // Workaround: Remove Gameplay/
This is strange as UE-92876 seemed to be caused by the opposite problem (NOT having the path in the include statement).
1 Like
Important additional info: this happens if PUBLIC and PRIVATE are NOT checked
Is no one else running into this? We regularly add new C++ classes to the game and it’s extremely annoying. Is there something we are missing, or is everyone also manually editing every CPP file every single time?
I can confirm that I do not run into this problem. All of my includes are the full path as you have and it all works just fine.
I don’t bother using the editor to make any of my cpp files, but that shouldn’t matter.
You’re likely missing something in your Build.cs. That’s what controls things like include directories (which should include the public directories of any Public or Private module dependencies).