What is VSCode missing in the Build Process vs the Editor Compile Process?

Hello World!

First thing: I am new to C++ Development and a big sucker vor VS Code.

My Problem

Last week I implemented and built successfully a module. However once I make a change in my Source Code and use VS Code’s Build Task “Win64 Development Build” (in this case), it compiles successfully after a very long time, without any problems. The Result however does not show in UE4, even when I restart the project.
Then I hit compile in the UE-Editor and it compiles super fast and then it works.

What I tried so far

  1. I rebuilt the project after cleaning the build files.
  2. I created new “vscode” project files. (Still the same problem)
  3. I created a new project from the Ground up, with a C++ Template and added a Test Class just to test the Compilation process

My Log Files

From VSCode “Win64 Development Build”

`> Executing task in folder CompilingTest: Engine\Build\BatchFiles\Build.bat CompilingTest Win64 Development D:\4_developing\playground\unreal-cpp\CompilingTest\CompilingTest.uproject -waitmutex <

Creating makefile for CompilingTest (no existing makefile)
Parsing headers for CompilingTest
Running UnrealHeaderTool “D:\4_developing\playground\unreal-cpp\CompilingTest\CompilingTest.uproject” “D:\4_developing\playground\unreal-cpp\CompilingTest\Intermediate\Build\Win64\CompilingTest\Development\CompilingTest.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -abslog=“C:\Users\Sebas\AppData\Local\UnrealBuildTool\Log_UHT.txt” -installed
Reflection code generated for CompilingTest in 11,6242786 seconds
Building CompilingTest…
Using Visual Studio 2019 14.28.29335 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).

Building 10 actions with 8 processes…
[1/10] Default.rc2
[2/10] SharedPCH.Engine.ShadowErrors.cpp
[3/10] CompilingTest.cpp
[4/10] CompilingTest.init.gen.cpp
[5/10] FloatingActor.cpp
[6/10] CompilingTestGameModeBase.cpp
[7/10] FloatingActor.gen.cpp
[8/10] CompilingTestGameModeBase.gen.cpp
[9/10] CompilingTest.exe
Creating library D:\4_developing\playground\unreal-cpp\CompilingTest\Binaries\Win64\CompilingTest.lib and object D:\4_developing\playground\unreal-cpp\CompilingTest\Binaries\Win64\CompilingTest.exp
[10/10] CompilingTest.target
Total time in Parallel executor: 69,73 seconds
Total execution time: 86,12 seconds`

From within UE4 Editor

Total execution time: 41,90 seconds Building CompilingTestEditor... Using Visual Studio 2019 14.28.29335 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10). Building 6 actions with 8 processes... [1/6] CompilingTest.init.gen.cpp [2/6] FloatingActor.cpp [3/6] FloatingActor.gen.cpp [4/6] UE4Editor-CompilingTest-9885.lib Creating library D:\4_developing\playground\unreal-cpp\CompilingTest\Intermediate\Build\Win64\UE4Editor\Development\CompilingTest\UE4Editor-CompilingTest-9885.lib and object D:\4_developing\playground\unreal-cpp\CompilingTest\Intermediate\Build\Win64\UE4Editor\Development\CompilingTest\UE4Editor-CompilingTest-9885.exp [5/6] UE4Editor-CompilingTest-9885.dll Creating library D:\4_developing\playground\unreal-cpp\CompilingTest\Intermediate\Build\Win64\UE4Editor\Development\CompilingTest\UE4Editor-CompilingTest-9885.suppressed.lib and object D:\4_developing\playground\unreal-cpp\CompilingTest\Intermediate\Build\Win64\UE4Editor\Development\CompilingTest\UE4Editor-CompilingTest-9885.suppressed.exp [6/6] CompilingTestEditor.target Total time in Parallel executor: 40,67 seconds

Final Note

Since the compilation process works from within the Editor I think I will be able to finish my project.
However this really Bugs me, because I can’t get my Head around it: Is it because of the UnrealBuildTool?

I would appreciate any Insights or Pointers to a nice Source to understand this problem

Regards,
Yogurt!

By the way! I found it out by pure coincidence. There are two different “build” tasks in VSCode. One is a normal build and the other is an EditorBuild. When you select the latter it compiles additional “.dlls” which trigger Unreal’s hot reload. For anyone wondering. However, I also have a colleague which can compile fine by just using the normal “build” task.

tl;dr For anyone having the same issue, compile using "Editor Build ".

1 Like