About 'Include What You Use For 4.17+'!

  • Converting old projects to IWYU.
  • Order of headers with IWYU.
  • Removing monolithic headers.
  • How to find headers.

(Unique Video Reference: 9b_BE_URC)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

3 posts were split to a new topic: Failed to Generate Project Files

Hello,

Went through this lecture with VS Code and was not able to get the autocomplete working, even with the #include “GameFramework/Actor.h” directive.

I did some research and the following seems to be a temporary solution?
http://jollymonsterstudio.com/2018/11/02/unreal-c-with-visual-studio-code/

I think i’ll go without autocomplete for now, but please advise.

Intellisense in VS Code can be somewhat more tricky to get going.

Its nice to have a full blown IDE like the regular VS :slight_smile:

Code might be OK to learn on but it has too many possible problems for actual work. Auto complete, code generation, less time spent on playing with the code editor are all great things to have working correctly.

One reason why its a shame Epic did this IWYU. A lot less time spent building sure but more time spent on looking up headers. Maybe in 10 years they’ll code out a better way. I know they can if they want to.

Thanks for the info.

I was hoping I could keep using VS Code since you guys converted me :).
I think I will finish out this project with VS Code, but I’ll consider switching to visual studio for the next one…

I really like VS Code. I find tha VS autocomplete is so slow sometimes that it’s completely useless to me.

Hello,

I am new to UE and to game programming in general. I am starting with BuildingEscape, particularly in lecture " ‘Include What You Use For 4.17+’ which is the 13th lecture of the section, and 70th in archived Unreal course.

I realized that most of the changes Sam show are now included in UE 4.22.3, however, I still ahve some basic things to sort out. I would appreciate any help I could get. Here we go:

Q1: I cannot compile from VScode. Since it recognizes entire folders instead of '‘solution’, am not 100% from which cpp file I should run ‘CTRL+SHIFT+B’ and/or this decision is relevat or not.

Q2: Regardless if I use

		bUseUnityBuild = false;
	 	bUsePCHFiles = false;

in .Editor.Target.cs, when I open BuildingEscape.cpp and build, I get the following ‘Missing precompiled manifest for ‘Launch’’ error:

Terminal will be reused by tasks, press any key to close it.

> Executing task in folder BuildingEscape: Engine\Build\BatchFiles\Build.bat BuildingEscape Win32 Debug 'C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\BuildingEscape.uproject' -waitmutex <

Using 'git status' to determine working set for adaptive non-unity build (C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape).
Creating makefile for BuildingEscape (no existing makefile)
Parsing headers for BuildingEscape
  Running UnrealHeaderTool "C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\BuildingEscape.uproject" "C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win32\BuildingEscape\Debug\BuildingEscape.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for BuildingEscape in 16,7776984 seconds
ERROR: Missing precompiled manifest for 'Launch'. This module was most likely not flagged for being included in a precompiled build - set 'PrecompileForTargets = PrecompileTargetsType.Any;' in Launch.build.cs to override.
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

So far, I only compile from UE editor, and

LogSlate: FSceneViewport::OnFocusLost() reason 2
LogSlate: FSceneViewport::OnFocusLost() reason 2
LogSlate: FSceneViewport::OnFocusLost() reason 2
LogSlate: FSceneViewport::OnFocusLost() reason 2
LogSlate: FSceneViewport::OnFocusLost() reason 2
LogSlate: Window 'About Unreal Editor' being destroyed
LogSlate: FSceneViewport::OnFocusLost() reason 0
Candidate modules for hot reload:
  BuildingEscape
Launching UnrealBuildTool... [C:/Program Files/Epic Games/UE_4.22/Engine/Binaries/DotNET/UnrealBuildTool.exe  -ModuleWithSuffix=BuildingEscape,1706 Win64 Development -TargetType=Editor -Project="C:/Users/Home2/Documents/UE Programming Course/OLD Course/03_BuildingEscape/BuildingEscape/BuildingEscape.uproject" "C:/Users/Home2/Documents/UE Programming Course/O
LD Course/03_BuildingEscape/BuildingEscape/BuildingEscape.uproject"  -IgnoreJunk]
Warning: Starting HotReload took  0.0s.
CompilerResultsLog: New page: Compilation - 24 jul 2019 04:25:31
CompilerResultsLog: Using 'git status' to determine working set for adaptive non-unity build (C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape).
CompilerResultsLog: Invalidating makefile for BuildingEscapeEditor (BuildingEscapeEditor.Target.cs modified)
CompilerResultsLog: Parsing headers for BuildingEscapeEditor
CompilerResultsLog:   Running UnrealHeaderTool "C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\BuildingEscape.uproject" "C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\BuildingEscapeEditor\Development\BuildingEscapeEditor.uhtmanifest" -LogCmds="lo
ginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
CompilerResultsLog: Reflection code generated for BuildingEscapeEditor in 8,9206503 seconds
CompilerResultsLog: Using Visual Studio 2019 14.21.27702 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702) and Windows 10.0.17763.0 SDK (C:\Program Files (x86)\Windows Kits\10).
CompilerResultsLog: Building 9 actions with 8 processes...
CompilerResultsLog:   [1/9] BuildingEscape.cpp
CompilerResultsLog:   [2/9] PositionReport.cpp
CompilerResultsLog:   [3/9] BuildingEscape.init.gen.cpp
CompilerResultsLog:   [4/9] PositionReport.gen.cpp
CompilerResultsLog:   [5/9] BuildingEscapeGameModeBase.cpp
CompilerResultsLog:   [6/9] BuildingEscapeGameModeBase.gen.cpp
CompilerResultsLog:   [7/9] UE4Editor-BuildingEscape-1706.lib
CompilerResultsLog:      Creating library C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\BuildingEscape\UE4Editor-BuildingEscape-1706.lib and object C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4E
ditor\Development\BuildingEscape\UE4Editor-BuildingEscape-1706.exp
CompilerResultsLog:   [8/9] UE4Editor-BuildingEscape-1706.dll
CompilerResultsLog:      Creating library C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win64\UE4Editor\Development\BuildingEscape\UE4Editor-BuildingEscape-1706.suppressed.lib and object C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Intermediate\Build
\Win64\UE4Editor\Development\BuildingEscape\UE4Editor-BuildingEscape-1706.suppressed.exp
CompilerResultsLog:   [9/9] BuildingEscapeEditor.target
CompilerResultsLog: Total time in Parallel executor: 3,76 seconds
CompilerResultsLog: Total execution time: 15,65 seconds
LogMainFrame: MainFrame: Module compiling took 15.852 seconds
LogUObjectHash: Compacting FUObjectHashTables data took   0.80ms
LogContentBrowser: Native class hierarchy updated for 'BuildingEscape' in 0.0005 seconds. Added 2 classes and 2 folders.
Display: HotReload successful (0 functions remapped  0 scriptstructs remapped)
LogUObjectHash: Compacting FUObjectHashTables data took   1.36ms
LogContentBrowser: Native class hierarchy populated in 0.0108 seconds. Added 2735 classes and 663 folders.
Display: HotReload took 16.0s.

So I see no errors in UE’s Output.log

Q3: On the other hand, ‘Launch’ folder is not created, as you can see in the screenshot above, while UE documentation does not mention any ‘Lauch’ folder in their directory structure document. It seems that this folder is used when lauching the game to a given platform (?), which could make sense if we don’t see it right now.

Thank you in advance for all your help.

Cheers.

/Nicolás

Building works differently in VSCode. I can’t remember what the shortcut is off the top of my head. It shouldn’t matter which file you are in though.

1 Like

Thank you Sam. Do you have any ideas of the

ERROR: Missing precompiled manifest for 'Launch'.

i am facing? it seems that UE can compile without issues, but when I compile from VScode, I get this error.

How are you compiling in VS Code?

1 Like

Hi Sam,

Actually I just figured out how to properly compile and recreate the error messages I you and Ben have been reproducing in the latest lectures.

The way I do now is “Ctrl+Shit+B” and then select the option

BuildingEscape Win32 DebugGame Build

as the first option in screenshot below

and now I get a sucessfull build regardless of from which *.cpp or *.h file I launch the build task.

> Executing task in folder BuildingEscape: Engine\Build\BatchFiles\Build.bat BuildingEscape Win32 DebugGame 'C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\BuildingEscape.uproject' -waitmutex <

Using 'git status' to determine working set for adaptive non-unity build (C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape).
Parsing headers for BuildingEscape
  Running UnrealHeaderTool "C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\BuildingEscape.uproject" "C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Intermediate\Build\Win32\BuildingEscape\DebugGame\BuildingEscape.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for BuildingEscape in 6,5762158 seconds
Using Visual Studio 2019 14.21.27702 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702) and Windows 10.0.17763.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 4 actions with 8 processes...
  [1/4] OpenDoor.cpp
  [2/4] OpenDoor.gen.cpp
  [3/4] BuildingEscape-Win32-DebugGame.exe
     Creating library C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Binaries\Win32\BuildingEscape-Win32-DebugGame.lib and object C:\Users\Home2\Documents\UE Programming Course\OLD Course\03_BuildingEscape\BuildingEscape\Binaries\Win32\BuildingEscape-Win32-DebugGame.exp
  [4/4] BuildingEscape-Win32-DebugGame.target
Total time in Parallel executor: 7,91 seconds
Total execution time: 15,33 seconds

Terminal will be reused by tasks, press any key to close it.

I think is enough with the C/C++ extension offered by Microsoft, but in my case when I started with BullCowGame Archive version in VSCode, I had to install g++ compiler and follow the instructions in this LINK + some youtube videos here and there…

Now I am in BuildingEscape, Archived version, and seems to work fine now with VScode and UE 4.22.3.

I am not 100% sure if UE calls for g++ compiler, but at least with the step above I manged to copllie and have Intelli-Sense working.

Thank you for your concern, I will let you know if I have more issues along the way. Hopefully not.

BR
Nicolas.

1 Like

Privacy & Terms