Adding New Folder to C++ Browser - UE4 Crashes

Hi there. I followed Sam’s video where he is creating a MainMenu class in C++ . In the video he creates a new folder ‘MenuSystem’ and puts the class in that folder.

I had tried this many times and it always failed. But since I was following the video I decided to do it again. And it did still fail. It says my folder/filename cannot be found.

I tried Generating VS project again.
Also deleted Binaries, Intermediate, Saved and Proj folders/files in my project. Right-clicked uproject and generated again. It still fails and says “Try Compiling From source”

The only ‘workaround’ I can manage is to instead have all CPP files inside the base folder from UE4.

Anyone else able to add folders in this way since UE4.27?

Thanks

1 Like

Hi Clunk,
Just to be sure as to the steps you’re following, you are creating a folder in the C++ and then adding the new class to this?

if I recall correctly, the generated files, or the includes are prefixed with the folder name which is actually wrong. You need to edit the C++ file in visual studio/code/editor of choice to remove this in your CPP file and then build the code.

I might be wrong about this but I think I saw this issue with 4.25 or possibly 4.26 and this was the issue - I’ve definitely seen this behaviour before.

3 Likes

Thank you for the help once again :smiley:

I did eventually notice the #include in the subfoldered CPP files had wrongly added the subfolder in. I did edit it so for example #include "MenuSystem/Menu.h" changes to #include "Menu.h" .

With that said, I decided to just change it back to all my CPP/H files inside the same folder (root c++ folder).

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms