[Closed] Documentation on includes, project generation, source folders
I am trying to organise my project files. I would like to use subfolders for my code, and I need to include non-generated classes (like Slate) as well. I have been trying for hours, tried to copy the Classes/public/private structure without result (also, it is just awful to use), I have tried to put everything at the root... I have tried everything for the past four hours and I am going mad, though I am experienced with making build systems...
Why is my xxxClasses.h empty ?
How can I add code without using the "add code to project" that exposes only basic classes ?
How can I use subfolders the way I want ?
Why does "Include X.h" does not work in project.h when the file is just alongside ?
Is there any kind of logic in this mess ?
The question has been closed Apr 28 '15 at 07:44 AM by StrangerGwenn for the following reason:
The question is answered, right answer was accepted
Sorry you're having such a hard time getting started with UE4. Based on your questions I will assume that you did not yet have a chance to take a look at our Online Documentation, particularly the special Section for Programmers, so let me try to push you in the right direction to get up and running as quickly as possible.
A quick overview on how Unreal projects are organized can be found on the Directory Structure page, and the basic knowledge required for project compilation is documented on the Compiling Game Projects page. UE4 is a cross-platform engine that supports development on Windows, MacOS and soon Linux, so our means of managing project files need to be cross-platform as well. Our solution to managing things like header include directories, library dependencies and build settings are the .Build.cs and .Target.cs files that exist in each project.
The Managing Game Code page describes the different ways of adding code to your project. The Add Code To Project feature in the Editor is primarily meant for creating new game classes, because those require special markup that is usually not known to new users. For everything else you normally use Visual Studio as you would in any other game engine that is built in C++. The Add Code To Project feature currently does not allow you to specify a sub-directory, but we are working on that as I'm writing this, and it will probably be in the 4.2 release.
While sub-directories and files in the Public folders are enumerated automatically, file paths in the Private directory must be explicitly listed in the PrivateIncludePaths array of the project's .Build.cs file. In the past we have considered enumerating private sub-directories automatically as well, but after weighing the advantages and disadvantages have decided against it for the time being. We may change this in the future, provided we are finding compelling reasons.
The Classes directory is actually in the process of being deprecated. If you are adding new UObject based classes through Visual Studio you are now allowed to place them in either the Public or the Private directory, and it will just work. When you are adding UObject based classes manually in Visual Studio, remember that some extra markup will be required. You can find all about that on the Edit Class Header documentation page.
I hope that these quick pointers will allow you to get started with UE4, and we're looking forward to all the awesome things you will be creating. If you need further assistance, please let us know! If it is related to this question, you can post a comment right here, otherwise start a new thread on AnswerHub. Thanks!
answered Apr 04 '14 at 08:36 PM
To add directories with header files open Build.cs file of your project and add following lines:
and so on. You might want to use PublicIncludePaths instead/together, depends on your goals.
To enable Slate in your project add next line to the same file
Follow this question
Once you sign in you will be able to subscribe for any updates here