Add new empty C++ Class Compiling failed

Generally if you are creating additional folders in C++ to organize your coding or as public private, Unreal creates classes with relative path like #include "[YourFolderName]/[YourClass].h" and this creates confusion in compiler and UBT.

To solve this add below code to your [ProjectName].Build.cs

PublicIncludePaths.AddRange(new string[] { "[ProjectName]" });

You will no longer have error while using wizard at the editor.
Additionally you can organize your cpp codes easily such below :

341663-uytmk21fw2.png

3 Likes