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!

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’.

still have same problem, below is a piece of output log from a blueprint project. The tools aren’t communicating well with each other…

ResultsLog: Error: UnrealHeaderTool failed for target ‘c_OOOOEditor’ (platform: Win64, module info: C:\UE4projects\c_OOOO\Intermediate\Build\Win64\c_OOOOEditor\Development\c_OOOOEditor.uhtmanifest, exit code: OtherCompilationError (5)).

Here are some links to posts of a similar/same nature:

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

1 Like

Still no feedback on this topic? How could my copy be any different than anyone else’s?

Make sure that your cpp files are in the right directory. If you added a class through Visual Studio, it may look like it is in that directory through the filters of visual studio, but in reality the files are at the solution level. Also, have you tried rebuilding via Visual studio or regenerating project files?

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’.

The below image is of the source folder from Windows 10 Explorer perspective.

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

In the VS2017 Output window below you can see the build succeeded and the files are seen, but they do not display in the ‘content browser’. only the Actor class and the GameModeBase show in the ‘content browser’.

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

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.

Append of blank C++ project and blank Blueprint project:

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

Based on the build log I guess some are native C++ classes (IE: not inherited from UObject).

And I believe at this point the editor just can’t display native c++ classes due to the lack of reflection. If you have other error please post the file in question.

BTW you should really not name your files like this…

They should display. I was just fiddling around trying to get them to display, that is why you see the funny names.

I just created a new FPS project with 4.21, and added a new native C++ class by clicking Add New->C++ Class->Choose Paraent: None->Create. The new class doesn’t show up in Content Browser, as expected.

Do you have any native class that does show up in Content Browser? If not then it seems like an engine issue and you should send a bug report to Epic. For me it’s a very trivial problem as I only browser code in VS.

It’s just a bug, And I am not sure how to manually add the ‘.gen.cpp’ file that it needs to be visible in ‘content browser’.

Any class derived from “Object” (aka UObject) should show up in Content Browser.

uhuh, so if I create an ‘empty c++ class’ through the editor do you have an example of how to add that ‘Uobject’ wrapper code to get it to generate that ‘.gen.cpp’ file?

To convert a native C++ class into UObject, follow the sample code here:

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "UMyObj.generated.h"

UCLASS(BlueprintType)
class UMyObj: public UObject
{
	GENERATED_BODY()
public:
	UMyObj();
//...Below can remain the same

Basically there are 3 major changes from native C++ to UObject:

  1. Class name need to have proper prefix. EX: Change MyObj into “UMyObj”. (File name should remains the same. )

  2. Includes engine headers and UBT generated file.

  3. Add macros (UCLASS, GENERATED_BODY)

1 Like

not sure where you got that, but it is not working for me. Could you show a ‘side by side’ pic of the ‘content browser’ and the .h file of the empty class you edited to get the empty class to show in the ‘content browser’?

Nah that’s too much work for me. You should take those pictures and tell me why it doesn’t work.

I don’t know why it doesn’t work, but best guess is it is because you are including a file that isn’t there or it doesn’t see. The engine does not appear to be creating the generated file or is not seeing it.