[UE5] Why are my project files in the intermediate folder?

Hmm, that is strange. Perhaps this is something that can help you:

This question has been asked by another user before. The answer can be found here: https://rocket.unrealengine.com/questions/2201/c-why-are-files-put-in-the-intermediate-folder.html

Here is what Mike Fricker said about the intermediate folder:

When you’re creating new C++ classes in Visual Studio, you’ll need to take note of where they’re placed. You definitely do not want to save them under the Intermediate folder. That will only lead to sadness. Here is the general idea:

If you plan you declare UObjects or UStructs in your header file (.h), you’ll need to make sure its saved under the Classes sub-folder for your game module. This is so that UnrealHeaderTool will be able to locate these headers, parse them, and automatically generate additional C++ code for those classes. For example:

/Source//Classes/MyUObject.h

Most of your other non-UObject C++ header files (.h) should go in your module’s Private folder. This is just where we put source files and headers that aren’t exposed to other (sibling) modules.

/Source//Private/MyGameFeature.h

All of your game’s C++ source files (.cpp) should go into your module’s Private folder. Source files are never “public”.

/Source//Private/MyGameFeature.cpp

You may decide to use multiple C++ modules (.dll’s) for your game. If you do, then you can place classes in a Public folder to allow your game module’s sibling modules to access those APIs, or vice-versa. This is a more complicated use case that I can elaborate more on if you want. Also note that currently, all files in the “Classes” folder are also considered Public, even though most of the time they will only be used in the module that declared the class. An example of a publically exposed header would be:

/Source//Public/MyPublicAPI.h

Let me know if you have any more questions like this!

–Mike

I hope that this has helped to answer your question. If there is anything else that needs clarification, please let me know.

Text from this post: Intermediate Folder - #2 by ue4-archive