Some C++ classes won't load into content browser

Error Message from ue4 editor:

Successfully added class
‘JustinsSlateWidgetStyle’, however you
must recompile the ‘a_OOOO’ module
before it will appear in the Content
Browser. Failed to automatically hot
reload the ‘a_OOOO’ module.

Would you like to open the Output Log
to see more details?

Feedback? Why doesn’t it just load up the new class?

The Output Log from ue4 editor:

CompilerResultsLog: ERROR: UBT ERROR: Failed to produce item: C:\UE4projects\a_OOOO\Binaries\Win64\UE4Editor-a_OOOO-5413.dll

CompilerResultsLog: (see …/Programs/UnrealBuildTool/Log.txt for full exception trace)

CompilerResultsLog: Total build time:
15.96 seconds (Parallel executor: 0.00 seconds)

LogMainFrame: MainFrame: Module compiling took 16.204 seconds

Warning: HotReload failed, recompile failed

Warning: RebindPackages failed because compilation failed.

LogSlate: Window ‘Message’ being destroyed

LogSlate: Window ‘Add C++ Class’ being destroyed

LogSlate: Took 0.000207 seconds to synchronously load lazily loaded font ‘…/…/…/Engine/Content/Slate/Fonts/DroidSansMono.ttf’ (77K)

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.000 sec). This should never happen. Something is wrong with the timer delegate!

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.000 sec). This should never happen. Something is wrong with the timer delegate!

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.000 sec). This should never happen. Something is wrong with the timer delegate!

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.001 sec). This should never happen. Something is wrong with the timer delegate!

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.001 sec). This should never happen. Something is wrong with the timer delegate!

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.001 sec). This should never happen. Something is wrong with the timer delegate!

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.001 sec). This should never happen. Something is wrong with the timer delegate!

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.001 sec). This should never happen. Something is wrong with the timer delegate!

LogUnrealEdMisc: Warning: Heartbeat event firing too frequently (0.002 sec). This should never happen. Something is wrong with the timer delegate!

269053-b-ooooin2019-02-19-140407.jpg

In the ‘Visual Studio 2017 Solution Explorer’ image is the c++ files created through the ‘ue4 editor’, you can see the list of files. In the ‘ue4 Content Browser’ image you can see the list of c++ class files that is actually showing up in the ‘content browser’. Most of the files are not displaying as they should in the ‘content browser’.

I went through and checked the 17 common classes. In a blank c++ project only 2 of the 17 would not show up in the ‘content browser’. In a blank Blueprint project all 17 classes failed to show up in the ‘content browser’ correctly. This is version 4.21.2.

C++PROJECT:

  1. EMPTY CLASS
  2. SLATE WIDGET CLASS

BP PROJECT:

1)  EMPTY CLASS
2)  CHARACTER CLASS
3)  PAWN CLASS
4)  ACTOR CLASS
5)  ACTOR COMPONENT CLASS
6)  SCENE COMPONENT CLASS
7)  PLAYER CAMER MANAGER CLASS
8)  PLAYER CONTROLLER CLASS
9)  GAME MODE BASE CLASS
10)  WORLD SETTINGS CLASS
11)  HUD CLASS
12)  PLAYER STATE CLASS
13)  GAME STATE BASE CLASS
14)  BLUE PRINT FUNCTION LIBRARY CLASS
15)  COMPOUND WIDGET CLASS
16)  SLATE WIDGET STYLE CLASS
17)  UREAL INTERFACE CLASS

Regenerating project files does not work. I deleted 'binaries', 'intermediate', and 'saved' and regenerated the files, didn't work. 

In the examples above all c++ classes were created from the ue4 editor and all the c++ class files are in the project source folder, but do not show up in the 'content browser'.

Here are some links to posts of a similar/same nature:
------------------------
https://answers.unrealengine.com/questions/595457/classes-not-showing-up-in-content-browser.html

https://forums.unrealengine.com/development-discussion/c-gameplay-programming/110567-c-classes-not-showing-up-in-content-browser

https://answers.unrealengine.com/questions/567440/c-classes-arent-showing-in-content-browser.html

https://answers.unrealengine.com/questions/264564/c-class-not-showing-up-in-content-browser.html

https://answers.unrealengine.com/questions/874211/view.html

Firsts of all note that content browser does not show files but only classes that enigne see. It only shows UObject, those are only classes physically visible to the engine as it’s only classes that reflection system tracks. C++ classes after completion in to CPU machine code are losing there bodies and even OS and CPU can not distinguishes them, in reality they just logical elements used during compilation to generate code. UE4 in order to track information about classes it register them in so called reflection system, using tool called UnrealHeaderTool which scans header too and generates extra C++ code that registers the classes when your module is loaded, as well as there contence and other elements like structs enums, any thing that ■■■ macros like UCLASS, UPROPERTY, UENUM etc, people call the popularly UMACROS. Also not all classes in UE4 are UObject based, most notably Slate classes (thats why Slate needs wrapper like UMG in order to be used with blueprints), so if you use those you will never see them in engine, in case of slate you can find some hints of them in widget reflector.

There also possibility of hot reload mess up, it is not perfect and somehow glitching out. If thigns get wrong and you see some strange behaviors, close editor, open your solution and build, this way you will have the cleanest build of your module. Also avoid hot reload when you editing blueprints if you can as it may cause corruptions. If you find any reproducible strange behavior on hot reload, raport a bug. Hot reload also don’t work on plugins.

Also classes in content browser is actually extra view primerly made for blueprint users, which are used to use content browser to place actors, also it does not show C++ files, in instead it shows UClass initiated from your module. So watch you see is not files, but information about classes in your compiled module. There other viewer which shows classes in more proper way, called “Class Viewer”. You can dins it in “Window”->“Devlopemt Tools”->“Class Viewer”, you can place it on you UI and even drag and drop same as you would do with Content Browser. If you can’t see your classes Class Viewer, it’s either filtered (check left upper corner menus) or your module is not loaded properly or it UE4 still use old version… or you class is not UObject based at all

Thanks for feedback. The ‘Slate Widget Class’ does show up correctly in a ‘C++ project’, but the ‘Slate Style Class’ does not show up correctly in the ‘C++ project’. I think every ‘class’ that can be created through the ‘content browser’ should show up in the ‘content browser’ and the ‘class viewer’, I think that is a part of what the ‘class creation tool’ is intended to do.

The ‘classes’ listed missing are also missing from the ‘class viewer’. They can only be seen in ‘explorer’ and in ‘visual studio’.

So it is a bug. What I don’t understand is why it effects me, and some other people, but does not effect most people.

for some reason the ‘.gen.cpp’ file is not generating for the classes. where it is generating the classes appear to show up properly.

Still need more feedback on this…

I cloned the UE4_4.21 source through ‘GitHub DeskTop 1.6.2’ and loaded up the editor, created a blank ‘BP project’ and a blank ‘C++ project’, The c++ project did not load up the ‘GUIeditor’(I don’t know why not I am not familiar with source editions), it did load up VS2017 though; The BP project did load up as expected, but both ‘Empty C++ Class’ and ‘C++ Actor Class’ failed to show up in the ‘content browser’, The Actor Class asked me to reload the module, the ‘Empty C++ Class’ did not.

All C++ classes created through the ‘content browser’ should show up in the ‘content browser’, So why don’t they?

The ‘Output Log’ is visible at 300% magnification.

Regarding the source version, I opened the ‘.sln’ file in ‘VS2017 Community Edition’ and pressed ‘ctrl + f5’ to build without debug. This caused the ‘.gen.cpp’ for ‘Actor Class’ to generate and so display correctly in ‘content browser’. However ‘Empty Class’ continues to be missing from the ‘content browser’

269350-emptyclassmissing2019-02-22-090010.jpg

Man AnswerHub is really dead… helloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…

‘Empty Class’ needs some stuff to display properly in ‘content browser’. Can someone tell me how to create the ‘.gen.cpp’ file it needs?

look I like I need to add the reflection system manually to get the empty class to show up properly in the ‘content’ browser’. Looking for the ‘how-to’, can someone send link?

I wonder how long it will take for someone to come up with an answer to this question?