C++ class not showing up in content browser

This is happening to me all the time and it is quite annoying. Here is how I reproduce it:

  1. Create a new c++ project.(doesn’t matter which framework I choose)
  2. Add a new c++ class. (again, doesn’t matter if I choose a parent class)
  3. It doesn’t show up in the content browser, although the source file is created and it seems it compiles successfully.

Also, if I right click on existing class and choose ‘show in explorer’, it doesn’t open my source folder, instead it opens ‘My Documents’.

Below is the output log by doing the above steps. I didn’t know which part could help so I pasted the entire thing. Hope it is not too verbose…

LogInit:Display: RandInit(-2001388344) SRandInit(-2001388343).
LogTaskGraph: Started task graph with 4 named threads and 7 total threads.
LogStats: Stats thread started
LogInit: Version: 4.8.0-2544947+++depot+UE4-Releases+4.8
LogInit: API Version: 2544947
LogInit: Compiled (64-bit): May 11 2015 01:55:26
LogInit: Compiled with Visual C++: 18.00.21005.01
LogInit: Build Configuration: Development
LogInit: Branch Name: ++depot+UE4-Releases+4.8
LogInit: Command line: -installedengine -rocket-installedengine -rocket
LogInit: Base directory: C:/Program Files/Epic Games/4.8/Engine/Binaries/Win64/
LogInit: Using libcurl 7.41.0
LogInit:  - built for x86_64-pc-win32
LogInit:  - supports SSL with WinSSL
LogInit:  - other features:
LogInit:      CURL_VERSION_SSL
LogInit:      CURL_VERSION_IPV6
LogInit:      CURL_VERSION_ASYNCHDNS
LogInit:      CURL_VERSION_LARGEFILE
LogInit:      CURL_VERSION_IDN
LogInit:  CurlRequestOptions (configurable via config and command line):
LogInit:  - bVerifyPeer = true  - Libcurl will verify peer certificate
LogInit:  - bUseHttpProxy = false  - Libcurl will NOT use HTTP proxy
LogInit:  - bDontReuseConnections = false  - Libcurl will reuse connections
LogInit:  - CertBundlePath = nullptr  - Libcurl will use whatever was configured at build time.
LogOnline:Warning: No default platform service specified for OnlineSubsystem
LogInit: Presizing for 0 objects not considered by GC, pre-allocating 0 bytes.
LogInit: Object subsystem initialized
LogInit: Selected Device Profile: [Windows]
LogInit: Applying CVar settings loaded from the selected device profile: [Windows]
LogInit: Computer: ZHENG-PC
LogInit: User: zheng
LogInit: CPU Page size=4096, Cores=4
LogInit: High frequency timer resolution =1.948759 MHz
LogMemory: Memory total: Physical=5.9GB (6GB approx)
LogMemory: Platform Memory Stats for Windows
LogMemory: Process Physical Memory: 50.48 MB used, 50.48 MB peak
LogMemory: Process Virtual Memory: 24.63 MB used, 24.63 MB peak
LogMemory: Physical Memory: 3205.20 MB used, 6058.17 MB total
LogMemory: Virtual Memory: 281.91 MB used, 8388608.00 MB total
LogTextLocalizationManager:Warning: Loaded localization resources contain conflicting entries for (Namespace:ContentBrowser, Key:ImportAssetToolTip):
Localization Resource: (C:/Program Files/Epic Games/4.8/Engine/Content/Localization/Editor/en/Editor.locres) Source String Hash: (-630476809) Localized String: (Import to {0}...)
Localization Resource: (C:/Program Files/Epic Games/4.8/Engine/Content/Localization/Editor/en/Editor.locres) Source String Hash: (1271782899) Localized String: (Imports an asset from file to this folder.)
LogD3D11RHI: Found D3D11 adapter 0: NVIDIA GeForce GT 525M  (Feature Level 11_0)
LogD3D11RHI: Adapter has 979MB of dedicated video memory, 0MB of dedicated system memory, and 2773MB of shared system memory, 1 output[s]
LogD3D11RHI: Found D3D11 adapter 1: NVIDIA GeForce GT 525M  (Feature Level 11_0)
LogD3D11RHI: Adapter has 979MB of dedicated video memory, 0MB of dedicated system memory, and 2773MB of shared system memory, 0 output[s]
LogD3D11RHI: Chosen D3D11 Adapter Id = 0
LogRHI: Texture pool is 1361 MB (70% of 1945 MB)
LogD3D11RHI: Async texture creation enabled
LogShaderCompilers:Display: Using Local Shader Compiler.
LogTemp:Display: Loaded TP DesktopTargetPlatform
LogTemp:Display: Loaded TP WindowsClientTargetPlatform
LogTemp:Display: Loaded TP WindowsNoEditorTargetPlatform
LogTemp:Display: Loaded TP WindowsServerTargetPlatform
LogTemp:Display: Loaded TP WindowsTargetPlatform
LogTemp:Display: Loaded TP AndroidTargetPlatform
LogTemp:Display: Loaded TP Android_ASTCTargetPlatform
LogTemp:Display: Loaded TP Android_ATCTargetPlatform
LogTemp:Display: Loaded TP Android_DXTTargetPlatform
LogTemp:Display: Loaded TP Android_ETC1TargetPlatform
LogTemp:Display: Loaded TP Android_ETC2TargetPlatform
LogTemp:Display: Loaded TP Android_PVRTCTargetPlatform
LogTemp:Display: Loaded TP IOSTargetPlatform
LogTemp:Display: Loaded TP LinuxNoEditorTargetPlatform
LogTemp:Display: Loaded TP LinuxServerTargetPlatform
LogTemp:Display: Loaded TP LinuxTargetPlatform
LogTargetPlatformManager:Display: Building Assets For Windows
LogDerivedDataCache:Display: Max Cache Size: 512 MB
LogDerivedDataCache: Loaded boot cache 0.06s 52MB C:/Users/zheng/AppData/Local/UnrealEngine/4.8/DerivedDataCache/Boot.ddc.
LogDerivedDataCache:Display: Loaded Boot cache: C:/Users/zheng/AppData/Local/UnrealEngine/4.8/DerivedDataCache/Boot.ddc
LogDerivedDataCache: FDerivedDataBackendGraph:  Pak pak cache file E:/projects/Unreal/MyProject2/DerivedDataCache/DDC.ddp not found, will not use a pak cache.
LogDerivedDataCache: Unable to find inner node Pak for hierarchical cache Hierarchy.
LogDerivedDataCache: FDerivedDataBackendGraph:  CompressedPak pak cache file E:/projects/Unreal/MyProject2/DerivedDataCache/Compressed.ddp not found, will not use a pak cache.
LogDerivedDataCache: Unable to find inner node CompressedPak for hierarchical cache Hierarchy.
LogDerivedDataCache:Display: Pak cache opened for reading ../../../Engine/DerivedDataCache/Compressed.ddp.
LogDerivedDataCache: Using Local data cache path C:/Users/zheng/AppData/Local/UnrealEngine/Common/DerivedDataCache: Writable
LogInit: Selected Device Profile: [Windows]
ImportText (ComponentSweepMultiTests): Missing closing parenthesis: (RootShapeAsset="/Engine/BasicShapes/Cube.Cube",ShapeType="TriggerCapsule",HitResult=(Time=0.50,Location=(X=-100.000015,Y=0.0,Z=100.000015),ImpactPoint=(X=-50.0,Y=0.0,Z=50.0),Normal=(X=-1.0,Y=-0.0,Z=0.0),ImpactNormal=(X=0.0,Y=0.0,Z=1.0),TraceStart=(X=-200.0,Y=0.0,Z=200.0),TraceEnd=(X=0.0,Y=0.0,Z=0.0))
ImportText (LineTraceSingleByChannelTests): Missing closing parenthesis: (RootShapeAsset="/Engine/BasicShapes/Cube.Cube",HitResult=(Time=0.50,Location=(X=-100.000015,Y=0.0,Z=100.000015),ImpactPoint=(X=-50.0,Y=0.0,Z=50.0),Normal=(X=-1.0,Y=-0.0,Z=0.0),ImpactNormal=(X=0.0,Y=0.0,Z=1.0),TraceStart=(X=-200.0,Y=0.0,Z=200.0),TraceEnd=(X=0.0,Y=0.0,Z=0.0))
LogMeshUtilities: No automatic mesh reduction module available
LogMeshUtilities: No automatic mesh merging module available
LogInit: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467
UdpMessaging: Initializing bridge on interface 0.0.0.0:0 to multicast group 230.0.0.1:6666.
SourceControl: Info Source control is disabled
SourceControl: Info Source control is disabled
SourceControl: Info Source control is disabled
SourceControl: Info Source control is disabled
LogSlate:Warning: Failed to load font data from '../../../Engine/Plugins/Editor/PluginBrowser/Content/Fonts/Roboto-Bold.ttf'
LogObj: 27534 objects as part of root set at end of initial load.
LogUObjectAllocator: 5590160 out of 0 bytes used by permanent object pool.
LogEngine: Initializing Engine...
LogAIModule: Creating AISystem for world NewWorld
LogInit: XAudio2 using 'Speakers (Realtek High Definition Audio)' : 2 channels at 48 kHz using 32 bits per sample (channel mask 0x3)
LogInit: FAudioDevice initialized.
LogDerivedDataCache: Saved boot cache 0.03s 52MB C:/Users/zheng/AppData/Local/UnrealEngine/4.8/DerivedDataCache/Boot.ddc.
LogInit: Texture streaming: Disabled
LogAnalytics: Creating configured Analytics provider AnalyticsET
LogAnalytics: [UEEditor.Rocket.Release] APIServer = http://et2.epicgames.com/ET2/. AppVersion = 4.8.0-2544947+++depot+UE4-Releases+4.8
LogAnalytics: [UEEditor.Rocket.Release] SetUserId 7ff8172f46c7d1d19018e3a9597b6579|be0f3ab738114b7198312536e7b252c2|7660d031-a086-4f69-9bb9-4956de7a7849
LogAnalytics: [UEEditor.Rocket.Release] AnalyticsET::StartSession
LogInit: Transaction tracking system initialized
BlueprintLog: New page: Editor Load
LogAssetRegistry: FAssetRegistry took 0.0101 seconds to start up
LogDirectoryWatcher:Warning: Failed to begin reading directory changes for ../../../Engine/Plugins/Experimental/CharacterAI/Content/. Error: 0
LogLinker:Warning: Asset '../../../Engine/Content/Tutorial/Mobile/SettingUpAndroidTutorial.uasset' has been saved with empty engine version. The asset will be loaded but may be incompatible.
LogConsoleManager:Warning: Console variable 'r.VSync' wasn't set ('GameSetting' has a lower priority than 'SystemSettingsIni')
LogCook:Display: Done creating registry. It took  0.00s.
SourceControl: Info Source control is disabled
Cmd: MAP LOAD FILE="../../../Engine/Content/Maps/Templates/Template_Default.umap" TEMPLATE=1 SHOWPROGRESS=1 FEATURELEVEL=3
LightingResults: New page: Lighting Build
MapCheck: New page: Map Check
LightingResults: New page: Lighting Build
LogParticles: Destroying 0 GPU particle simulations for FXSystem 0x000000001F7722A0
LogAIModule: Creating AISystem for world Untitled_1
LogEditorServer: Finished looking for orphan Actors (0.000 secs)
Cmd: MAP CHECKDEP NOCLEARLOG
MapCheck: Info Map check complete: 0 Error(s), 0 Warning(s), took 40.302ms to complete.
LogFileHelpers: Loading map 'Template_Default' took 0.579
LogCollectionManager: Loaded 0 collections in 0.002197 seconds
LogContentBrowser: Native class hierarchy populated in 0.0100 seconds. Added 1854 classes and 307 folders.
LogContentBrowser: Native class hierarchy updated for 'WidgetCarousel' in 0.0013 seconds. Added 0 classes and 0 folders.
LogContentBrowser: Native class hierarchy updated for 'AddContentDialog' in 0.0011 seconds. Added 0 classes and 0 folders.
LogCrashTracker: Crashtracker disabled due to settings.
LogUObjectGlobals:Warning: Failed to find object 'Class None.'
LogLoad: Full Startup: 11.52 seconds (BP compile: 0.11 seconds)
LogContentStreaming: Texture pool size is 0.000000MB
LogContentStreaming: Texture pool size now 200 MB
LogRenderer: Reallocating scene render targets to support 744x384 (Frame:2).
LogAssetRegistry: Asset discovery search completed in 16.7750 seconds
Running C:/Program Files/Epic Games/4.8/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject2 Win64 Development -editorrecompile "E:/projects/Unreal/MyProject2/MyProject2.uproject" -invalidatemakefilesonly -rocket
Invalidating makefiles only in this run.
Recompiling MyProject2...
Launching UnrealBuildTool... [C:/Program Files/Epic Games/4.8/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject2 -ModuleWithSuffix MyProject2 6516 Win64 Development -editorrecompile -canskiplink "E:/projects/Unreal/MyProject2/MyProject2.uproject" -rocket  -rocket]
CompilerResultsLog: New page: Compilation - Jul 28, 2015, 4:33:59 PM
CompilerResultsLog: Info Performing full C++ include scan (hot reloading a new target)
CompilerResultsLog: Info Creating makefile for hot reloading MyProject2 (no existing makefile)
CompilerResultsLog: Info Compiling game modules for hot reload
CompilerResultsLog: Info Parsing headers for MyProject2Editor
CompilerResultsLog: Info Reflection code generated for MyProject2Editor
CompilerResultsLog: Info Performing 2 actions (4 in parallel)
CompilerResultsLog: Info MyClass.cpp
CompilerResultsLog: Info [2/2] Link UE4Editor-MyProject2-6516.dll
CompilerResultsLog: Info    Creating library E:\projects\Unreal\MyProject2\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-MyProject2-6516.lib and object E:\projects\Unreal\MyProject2\Intermediate/Build/Win64\UE4Editor\Development\UE4Editor-MyProject2-6516.exp
CompilerResultsLog: Info -------- End Detailed Actions Stats -----------------------------------------------------------
CompilerResultsLog: Info Total build time: 19.43 seconds
LogMainFrame: MainFrame: Module compiling took 19.657 seconds
LogContentBrowser: Native class hierarchy updated for 'MyProject2' in 0.0018 seconds. Added 1 classes and 2 folders.
Warning: HotReload successful (0 functions remapped  0 scriptstructs remapped)
LogContentBrowser: Native class hierarchy populated in 0.0199 seconds. Added 1854 classes and 307 folders.
Warning: HotReload operation took 19.7s.
LogVSAccessor:Warning: Couldn't goto line number '0' in 'E:/projects/Unreal/MyProject2/Source/MyProject2/MyClass.h'
LogVSAccessor:Warning: Couldn't goto line number '0' in 'E:/projects/Unreal/MyProject2/Source/MyProject2/MyClass.cpp'
LogHotReload: New module detected: UE4Editor-MyProject2-6516.dll
LogHotReload: Starting Hot-Reload from IDE
LogContentBrowser: Native class hierarchy updated for 'MyProject2' in 0.0013 seconds. Added 1 classes and 2 folders.
Warning: HotReload successful (0 functions remapped  0 scriptstructs remapped)
LogContentBrowser: Native class hierarchy populated in 0.0193 seconds. Added 1854 classes and 307 folders.

I got my classes derived from UObject (but not those without a parent class) shown in Content Browser after I added the path to PrivateIncludePath in .Build.cs.

But I do see some other classes shown up without add the path…

Later I removed the path and compile, still show up.

===========================

UCLASS()

Just got to play with Unreal Engine recently as my hobby and I bumped into this problem as well.

The problem turned out to be my Visual Studio installment that was installed with default settings. I then uninstalled whole Visual Studio and reinstalled it with custom settings and chose to install additional c++ tools and language it self. Since then my UE4 has been able to build c++ classes into project and show classes on content view.

If anyone is still having this issue, hopefully this post helps! :slight_smile:

If you add a C++ class to a project it will compile the whole solution.

If you have any error in your code that makes it impossible to compile successfully, it won’t be able to update the contents.

  • Open Visual Studio through UE selecting any other c++ class you have.
  • Fix your code (or comment parts that don’t compile) to compile without any error.
  • Only when compilation returns success result close Unreal Editor
  • Open the project again.

Your classes will then be updated and syncronyzed with Visual Studio contents.

Note that any change you do in your classes without using UE (for example, changing derived class, etc) won’t be updated in Unreal unless you repeat this process.