Added class by editor wizard won't appear in Game.sln

When adding C++ class by editor wizard, its .cpp/.h did not appear in [Game].sln.

I tried following two things, but it did not resolve problem.

  • [Menu bar > File > Update Visual Studio Project] of Editor.
  • execute GenerateProjectFiles.bat

However, game project in “UE4.sln” in engine root directory have .cpp/.h of the above newly created class.

Version: 4.5.0-release, built from GitHub source code.

Hey TyounanMOTI-

I want to check to make sure I’m following the same steps you are for this problem. You build the engine from source and created a project then added code to it inside the editor. Then you opened the .sln file in the project folder and the class you added wasn’t there? Also, when you say “UE4.sln in the engine root directory” are you referring to the visual studio file for the engine itself? If you could provide some additional details to clarify your meaning it will help investigate what is happening.

Cheers

Hi ,

Thank you for your reply.

You build the engine from source and created a project then added code to it inside the editor. Then you opened the .sln file in the project folder and the class you added wasn’t there?
Yes, also, I created project from C++ “Empty” template project.

Also, when you say “UE4.sln in the engine root directory” are you referring to the visual studio file for the engine itself?
Yes, I mean solution file of engine itself. I wrote “UE4.uprojectdirs” so that Visual Studio project of the game appears in UE4.sln as “Games/[game project name]”.

Additionally, I found that the problem occur only when I create the game project under the engine root folder like following:

[UE4 root]/Projects/[Game]/[Game.sln]

When I create the project outside of engine root (like My Document), there is no problem.

Cheers,

TyounanMOTI

It seems like the problem is with saving files in the root install folder. You’re able to create a new project and add classes to it as long as the project is created in a different folder, correct?

You’re able to create a new project and add classes to it as long as the project is created in a different folder, correct?
Yes, it seems that there is no problem in case of different folder from engine root folder.

Hey TyounanMOTI-

What you’re seeing is expected when working with a project that is saved in the same location as the engine itself. When working out of the root directory it is expected that the UE4.sln file is the one in use. There are internal teams that follow the same workflow in their own projects. If you decide to save the project outside of the engine folder location then the .sln for the project itself is the file you’d want to use.

Cheers