Problem with generated dependencies?

Hey I don’t know if I’m doing something wrong but it seems to me that its a bit hit and miss when using add code to project… some classes are creating a .generated.h but is not getting added to the sln external dependencies, while others are getting .h and .cpp randomly added outside of the \class \private folders and when I inherited from StaticMeshActor it didn’t generate one at all though it tried to include it. Is this me doing something wrong or these classes just aren’t fully supported yet?

When your files are being added to unexpected locations, in which specific folders do they show up?

same location as the projectname.build.cs I just move them into their respective folders and it seems to work fine… Its when the .generated.h doesn’t show up in the dependencies that I cant compile

Using “MyGame” as the name of your game for demonstration reasons:

The External Dependencies folder is populated by intellisense based on the include statements found in files in that project. If the generated.h file is properly included and found then it should show up once intellisense has completed building if it does not you may have to restart VS to trigger a rebuild. All you need to do to include these classes is #include “MyGameClasses.h” in your MyGame.h file. To be clear, you should not have to explicitly include a generated.h file yourself.

As for building, if you put .h files in your MyGame\Source\MyGame\Classes folder then build, UnrealHeaderTool should generate a generated.h file in MyGame\Intermediate\BuildData\Include\MyGame. Does your static mesh actor’s generated.h file exist on disk at that location? If not, there is a chance UnrealHeaderTool could not read your file for one reason or another. If that happens it often appears as a build failure during compilation. What error are you seeing when your compile fails?

Hey I’m having that problem again the classes are in all the correct folders including the generated.h in MyGame\Intermediate\BuildData\Include\MyGame it just wont add the generated.h to the project dependencies. I’ve tried building it, rebuilding it, closing and opening VS and Generating the Visual Studio Files again to no avail. I’ve coded out references to the class so its building fine but yeah no dependency and when I do try to set (its a PlayerController this time) PlayerControllerClass it give me a “not a class or namespace” in VS and when I try to build.

Added another PlayerController class to the same project to just check if something fishy was happening and that class too is generating everything correctly but not showing up in the dependencies.

Funny thing is that both the .h files aren’t throwing errors on their #include"classname.generated.h"

By project dependencies, are you talking about the “External Dependencies” folder than Visual Studio adds synthetically to your project?

Yes I’m not sure if that is the actual problem or a symptom though because the files are getting generated in the necessary folders its just in visual studio, intellisense and when you build that they seem to be missing

Can you reproduce this issue with a project created from scratch using one of our code-based templates?

Well this is embarrassing… turns out I was missing the “A” in-front of my class so its all working now even the dependencies have shown up… sorry for wasting your time