Public Folder

Hi there,

I have a weird bug with the public folder in the 4.0.2 version

For some reasons the folder “ProjectName\Source\ProjectName\Public” doesnt seems to act like an “include directories” anymore so even if i move my ProjectName.h file to that folder and want to include in other code files i have to put “…/” in my #include which throw an error since this file works like a PCH.

By the way, why not justecreate the folder structure automaticly when creating solution or adding code files via the editor? The whole process is kinda ackward by having to move every files manually after the creation…

As for your first question, I use that approach in my modules, i.e. having a single main public header file in /Public/ that includes all other required public header files that may or may not be in sub-folders of /Public/. All files in /Public/ and its sub-folders should automatically be enumerated by Unreal Build Tool, so you should not require any relative paths. Make sure that your folder structure is set up the way you think it is - what’s shown in Visual Studio may not be exactly how things are on the hard-drive (remember that Visual Studio only knows virtual folders, it does not show the actual file system hierarchy). Take a look at the Settings module, for example.

As for adding code files in the Editor, we have made a first pass of improvements to the Add Code To Project dialog. I don’t know if it will make it into the upcoming 4.1 release - it will certainly be in the 4.2 release. If you get all your UE4 code from Github, then you might already have it or it should be available there very soon.