Unable to open the source file.

I am currently facing a problem. I want to use the following .h files:


include “EditorUtilitySubsystem.h”

include “EditorUtilityWidgetBlueprint.h”


To do this, I added “Blutility” in the corresponding .cs dependency file, but the header files give an error indicating that the source file cannot be opened. Then I tried using the full path:


include “Editor/Blutility/Classes/EditorUtilityWidgetBlueprint.h”

include “Editor/Blutility/Public/EditorUtilitySubsystem.h”


There are no errors shown in the editor, and it can find the corresponding .h files, but after compilation, it shows several compilation errors:


Cannot open source file “EditorUtilityWidget.generated.h”

Cannot open source file “WidgetBlueprint.h”

Cannot open source file “EditorUtilityWidgetBlueprint.generated.h”

Cannot open source file “EditorUtilitySubsystem.generated.h”

Cannot open source file “pas_thread_local_cache_node_ue.h”

Cannot open source file “verse_heap_config_ue.h”

Cannot open source file “verse_heap_ue.h”

Cannot open source file “verse_heap_config_ue.h”

Cannot open source file “verse_local_allocator_ue.h”

Cannot open source file “verse_heap_ue.h”

Cannot open include file: “WidgetBlueprint.h”: No such file or directory.


I referred to some information in the official documentation; did I miss something?

You need to follow the documentation correctly. It states in what module the needed file resides.

Add the needed module to your projects build files (), only then will the includes in the documentation work correctly

in most cases inside of your build file you have a list of public dependency modules called
PublicDependencyModuleNames

So if you need theBlutility module it would look like this

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Blutility" });

and then the default include of include “EditorUtilityWidgetBlueprint.h” will work

as for WidgetBlueprint.h it requires the module UMGEditor
so

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "Blutility", "UMGEditor" });

This should clear up the includes for the base unreal modules. Not sure about the verse extras, are they part of a plugin for Fortnite?

Hello! Thank you for your help. After checking, I found that I didn’t add ‘UMGEditor’, and the problem has been resolved. Thank you!

1 Like