'Problems to recompile a UE4 plugin
I am trying to recompile the Dialogo System plugin (https://forums.unrealengine.com/t/dialogue-system/44974) and I can't do it at all. I've tried several ways, including those suggested by the forum staff, but there's no way
This the error message I am getting:
Running C:/Program Files/Epic Games/UE_4.26/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="D:/Simulation/unreal/MyProject/MyProject.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE Invalidating makefile for MyProjectEditor (DialogueSystem.Build.cs modified) @progress push 5% Parsing headers for MyProjectEditor
Running UnrealHeaderTool "D:\Simulation\unreal\MyProject\MyProject.uproject" "D:\Simulation\unreal\MyProject\Intermediate\Build\Win64\MyProjectEditor\Development\MyProjectEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\renat\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed Reflection code generated for MyProjectEditor in 4,3286771 seconds @progress pop D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\BTComposite_Context.cpp(1): error: Expected BTComposite_Context.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\BTComposite_Question.cpp(1): error: Expected BTComposite_Question.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\BTComposite_QuestionGroup.cpp(1): error: Expected BTComposite_QuestionGroup.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\BTContextNode_Interface.cpp(1): error: Expected BTContextNode_Interface.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\BTDialogueFunctionLibrary.cpp(1): error: Expected BTDialogueFunctionLibrary.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\BTTask_CloseDialogue.cpp(1): error: Expected BTTask_CloseDialogue.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\BTTask_ShowPhrases.cpp(1): error: Expected BTTask_ShowPhrases.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\BTTask_WaitAnswer.cpp(1): error: Expected BTTask_WaitAnswer.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\DialogueButton.cpp(1): error: Expected DialogueButton.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\DialogueEventListener.cpp(1): error: Expected DialogueEventListener.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\DialogueSettings.cpp(1): error: Expected DialogueSettings.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\DialogueSystemModule.cpp(1): error: Expected DialogueSystemModule.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Private\QuestBook.cpp(1): error: Expected QuestBook.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\BehaviorTreeEditor\QuestionCustomization.cpp(1): error: Expected QuestionCustomization.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\BehaviorTreeEditor\ShowPhrasesCustomization.cpp(1): error: Expected ShowPhrasesCustomization.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\QuestBookEditor\QuestBookEditor.cpp(1): error: Expected QuestBookEditor.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\QuestBookEditor\QuestBookEditorCommands.cpp(1): error: Expected QuestBookEditorCommands.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\QuestBookEditor\QuestBookEditorCustomization.cpp(1): error: Expected QuestBookEditorCustomization.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\DialogueSystemEditorModule.cpp(1): error: Expected DialogueSystemEditorModule.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\DialogueSystemStyle.cpp(1): error: Expected DialogueSystemStyle.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\QuestBookAssetTypeActions.cpp(1): error: Expected QuestBookAssetTypeActions.h to be first header included. D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystemEditor\Private\QuestBookFactory.cpp(1): error: Expected QuestBookFactory.h to be first header included. Building MyProjectEditor... Using Visual Studio 2019 14.27.29111 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10). Building 13 actions with 12 processes... @progress 'Compiling C++ source code...' 0% @progress 'Compiling C++ source code...' 8% [1/13] Default.rc2 @progress 'Compiling C++ source code...' 15% [2/13] Default.rc2 @progress 'Compiling C++ source code...' 23% [3/13] PCH.DialogueSystem.cpp
D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Classes\BTTask_ShowPhrases.h(7): fatal error C1083: It1s not possible to open file include: 'Widget.h': No such file or directory
Please, some help. I really need to use this plugin to produce a demonstration of my project.
Solution 1:[1]
You could try what the log is suggesting and change the order of the includes. I suppose you're using a c++ project. Sometimes the order does matter. Also check if the plugin is added in the dependecies list in the build.cs file. This file is located inside your project source folder. You will see that in the file there is already a dependecies list and you should include the plugin name in the list and build again.
Solution 2:[2]
BTComposite_Context.cpp(1): error: Expected BTComposite_Context.h to be first header included.
Taking this one as an example it looks like the .cpp files have been either corrupted or modified in a way. In general when you have a .cpp file you'll want it to start with the same header file as the first include. So open one of these files and see whether or not it starts with something like
#include BTComposite_Context.h
My guess since it looks to be an old plugin it probably improperly starts with something like
#include Engine/Core.h
D:\Simulation\unreal\MyProject\Plugins\UE4-DialogueSystem-master\Source\DialogueSystem\Classes\BTTask_ShowPhrases.h(7): fatal error C1083: It1s not possible to open file include: 'Widget.h': No such file or directory
This error is actually what's causing you not to be able to compile. Likely because Widget.h has been moved in a future version of UE4 compared to what it was when this plugin was made almost 7 years ago.
Try changing from #include Widget.h to #include "Components/Widget.h"
If you look at Widget.cpp in the engine source you can see this is now the correct include path that is expected.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Luccas Schmigel |
| Solution 2 | Shaun Randall |
