Building with unreal build tools my project, I get an Error

I’m trying to build my projects without Visual Studio I want to see how it is done and also Visual Studio is humongus slugish and slow, just not my kind of thing.

So I followed a tutorial on how to build projects without VS.
This is the tutorial.

I followed it step by step and digested it down to understand it, but when I run from command prompt the following:

"C:\Program Files\Epic Games\UE_4.26\Engine\Build\BatchFiles\Build.bat" pdanEditor Win64 Development "C:\learnue\pdan\pdan.uproject" -waitmutex -NoHotReload

I get error.

ERROR: Expecting to find a type to be declared in a target rules named 'pdanEditorTarget'.  This type must derive from the 'TargetRules' type defined by Unreal Build Tool.

This is my pdanEditor.Target.cs file

using UnrealBuildTool;
using System.Collections.Generic;

public class EditorTarget : TargetRules
{
	public EditorTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
        DefaultBuildSettings = BuildSettingsVersion.V2;
		ExtraModuleNames.AddRange( new string[] { "pdanCore" } );
	}
}

========================================
I have two target files pdan.Target.cs and pdanEditor.Target.cs.
Under the Type label inside the files where you fill in the types pdan.Target.cs is type Game. and pdanEditor.Target.cs is type Editor

I tried changing: Type = TargetType.Editor; to Type = TargetType.EditorTarget;
Since I thought maybe it was explicit in the error it gave me asking for something:'pdanEditorTarget

So I changed inside the “pdanEditor.Target.cs”
From: Type = TargetType.Editor; To: Type = TargetType.EditorTarget;

now the error has changed and I get another form of error:

c:\learnue\pdan\source\pdanEditor.Target.cs(8,21) : error CS0117: 'UnrealBuildTool.TargetRules.TargetType' does not contain a definition for 'EditorTarget'
ERROR: Unable to compile source files.

It says it does not exist yet when I hit the “.” after Type = TargetType it let’s me fill in in fill in mode with"EditorTarget"

Either way I can’t compile the project.
Can someone please help me. Is the tutorial depreciated maybe ?
I’m using the latest UE4 version, just downloaded it a few days ago.

Well I made my project from scratch again and it went past this point, seems me renaming a file from the start was problematic, but I renamed it back, but it did not work, once you rename a file it’s over I saw, you have to rebuild the whole project.

Well I got past this point to the compiling stage where I got a “can’t create child” error.

Building 7 actions with 2 processes…
[1/7] ERROR: Unable to create child process
[2/7] Default.rc2

I was reading around that if you change things, versions you can get this error.
So you cannot build with 2.6 build tools ? a project that you would build manually for 2.5 ?
I don’t get it what is different, the target.cs files the .build.cs file ?

Finally I opened the unreal editor and loaded the uproject and it told me it was constructed with another version and that it cannot compile, even tho I did not create with the editor the project I was trying to build but manually with a tutorial from 2020

So the build tools from within unreal are different for each version? Can someone shed some light on this ? What is different when building, did the cs files change structure or is it something else ?

The build process mostly consists of UnrealHeaderTool, UnrealBuildTool, and the Visual Studio Command Line Tools.

You are not likely going to be able to mix and match versions of UHT or UBT, and they are built every time you change something that could change how they operate. So, I don’t know what the source of your problem here might be, and I’m not even particularly sure what your question is, because I can’t tell what is broken, only that something is broken.

Do you have the unreal .uproject, and the visual studio .sln ?

I tried to follow the tutorial, and got to the step where you build binaries and rest of the files with command line. So I can use any IDE and get rid of Visual Studio. The main point is building your game engine without Visual Studio, compiling and so on with IDEs like VScode but without Visual Studio installed

I have Microsoft Visual Build Tools with the msvc compiler installed.
It’s either asking for Visual Studio or the versions are indeed different and there is some difference in the build tools unreal has on it’s side between versions.

I’m not the only one looking for a solution to skip Visual Studio installation and usage, it’s too heavy and not my cup of tea. I already have 70GB of microsoft build tools , what am I going to get when I install Visual Studio, Lag + over 100 GB of MS Visual Build tools.

It is insane, we don’t like it. The build tools are bigger than the unreal engine it’s self, my whole drive is occupied by windows and build tools, and we play where ? Visual Studio is also laggy, and heavy, not fast + lots of hard drive space.

This tutorial was an oportunity to ditch Visual Studio and compile from command line + build game binaries the same way.

So the main question remains, is Unreal based on Visual Studio or can we compile without Visual Studio using the MSVC compiler with the MS build tools (without visual studio)

If possible how ? seems this guy installed VS2019 first and then went around the bush and did manual, but he has visual studio installed and we all wonder if we can get away with it without installing Visual Studio 2019 and just use Ms Build Tools with MSVC.

If you look at the whole tutorial you will see he also adds C++ classes and shows examples how to compile code so this is other than building binaries to launch game from exe file.

He has Visual Studio installed, now what to figure out is , I get error because I don’t have Visual Studio installed and I just have MSbuild tools installed or it’s from the fact that this tutorial is from 2020 and does not work with 4.26 ?

Ides like VScode and Sublime are fast and robust, but if I have to install Visual Studio for them, then there is no point in doing any of this since really no independence from Visual Studio.

Seldom when I had to test for windos I use Visual Studio Build Tools without installing visual studio to compile projects, and if there are any code issue then I open the project in QTCreator-windos by editing the editing cmake (hard) file of the project.

If you are downloading vs build tools offline or installing make sure that you have necessary workloads (ref) like vctools ,NetCoreBuildTools (nuget, .netcore3.x for UE5) and windows SDK. If this vb tools installation is correct then you should be able to open that in vscode or any other Ide too.

I used the regular installer. This is my installation and what I curentlly have installed, it is marked as you can see, I don’t think it’s offline, it asks you to build a cache first on your disk if it’s the offline version, this is the regular installer.
setup

NetCoreBuildTools ? you think this is because I don’t have ,NetCoreBuildTools ?
Also I tried to use Vscode from the editor by changing the option from Visual Studio 2019 that is default option to VCcode, and it does create a C++ class without Visual Studio installed then it says it failed to compile the class on “hot” meaning right away and that I should recompile it, when I restart to recompile it tells me that the project is “another version” and that compilation failed and it fails to load the project.

But this only when I turn Vccode option on from the editor, I can fill VCcode, it will fill the C++ code inside VCcode, the unreal Editor will open VC code but VCcode behaves strange reprasing my C++ code over and over.

If I leave the option with Visual Studio on inside the editor then when I try to generate a new C++ class it just says that there is no compiler, only if I change it to VScode it works and it actually opens up VCcode to load the project but when I restart the project inside unreal editor it fails to load up saying “it’s another version”

So you say it’s possible without visual studio, okay, good to hear, can you look at my picture please, I left the other SDK’s out, and the default one is installed, what else should I install ?

Point is if I leave Visual Studio 2019 on as an option, the build tools look for Visual Studio 2019 tool chain, I saw it in the logs, if I change it to Vscode I get errors and other problems.

So command prompt build where you build the target files and so on, you add classes manually, you can use something like Vccode that is free without having any connection to anything then manually compiling from the prompt.

I have not used the visual installer but try adding .Net Build Tools (check that nuget is selected) under this and latest 10sdk from the list and see if project compiles. If it still does not work, remove check if you have multiple versions installed, remove visual studio completely too. All together unreal only needs less than 10gb of build tools to fully function with c++.

I don’t have visual studio installed, those are just Visual built tools 2019 from visual installer.
The sdks are 10 additional gigs.

It just does the same but now after I installed the net.build tools it let’s me create a class in C++ with the MS Visual 2019 Build Tools inside the Editor this time (with visual studio 2019 selected as an option from the editor, where you can select clion, visual studio versions and VCcode) , but everything without Visual Studio installed, ( I only have the MS Built tools 2019 installed)

It did not work previously, with the visual studio 2019 option selected.


You could not create a c++ class with it on, now it’s possible after you told me to install net.build Tools.

So to test if it works I directly create a C++ from the editor, from File>create new c++ class, I just add an empty template, and see if it compiles “without visual studio.” I get the same error I got when I was using the prompt when I was trying to build my project after the tutorial + it was unable to compile and that the class was added with success but that I need to recompile.
Here is the actual picture with the log inside unreal engine.

So “unable to create child process” and “your class was added but it failed to compile please recompile”

I looked at the lib it uses in the log.
Using Visual Studio 2019 14.29.30037 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30037) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).

It’s Windows 10.0.19041.0 SDK that is curentlly installed, if you look in the picture I posted early, it is the one installed, and the msvc\14.29\30037 folder that I have.

What the hell is it’s problem, it has everything, this has been bugging me for 3 days already.
Folder:

Upon restarting the unreal engine, when you reload the file project it will say it’s “a different version” what different version, I’m perplex , it tries to compile it saying it failed and not loading the project at all. This happens if I add a new C++ class and try to restart the editor.

So the problem obvious and error is not from the fact that it’s a different version since I used the editor directly and created a C++ template that failed to compile, giving an error “Failed to create child process” and your class was added but it did not compile.

It’s the same error I got when I used the prompt to create things manually, only this time I created everything from inside unreal editor, a new c++ class from the editor tab. It’s funny because it actually gives “Different version” when you try to reload the file in the editor, but it’s created in the 4.26 editor so It can’t be different lol.

Can anyone have any solution ? or do I have to install VISUAL STUDIO MOSTROSITY that I personally do not like. (AT ALL)

Lol we can use unreal without that gigatic ide!

Option 1

In the editor if you have set the ide as vs code then click: File > Refresh … project file. Then compile from the editor.
Or

Option 2

From the explorer go to your project folder and delete the temporary folders like:
.vs
Build
Intermediate
(keep backup if to avoid mistakes)
Right click the .uproject file and click generate project files.
Then open the project and it should compile and start project if there is no code errors.

Try either option 1 or 2 to fix error of creating child process that you are getting now that you have installed the tool chain

No, I tried that with the VScode option on, it was before the only option that allowed me to create a C++ class, if it was set on visual studio (any version) it would say no compiler and did not create any class. Now with net.build tools it let’s you create the class with visual studio option on but fails to compile (just like with VScode option on) They all fail and produce that Child process error .

It does the same, I deleted all the folders that were added, intermediary and so on, I built the solution with generate visual studio project files 2019 from the u-file, from my project folder, and it builds without any problem, no errors at all, I get the building line and it finishes.
This is a good indication that visual ms build tools that Visual Studio 2019 uses are installed, but without visual studio 2019. It’s all there and the build is generated without any error.

I load the editor up, editor boots up, I choose my project that I just built with left click from windows explorer and look.

Says the same different version, yet I built everything.

and then I get after clicking okay,

Same outcome, project does not open.

What could the problem be ? I like tried everything.

After I deleted the intermediary and other folders that you said
Look:

This is garbage why I like microsoft less and less.
They like to drive people crazy with their BULOX.

I don’t use dos because of such issues!
You might be having some other error? Can you open the project in vs code ide and check the error? Or for us to find exact issue Can you go folder Saved/Logs/
can you post latest .log file of the project here or in pastebin?

MyProject2.log (10.6 KB)
UnrealVersionSelector-2021.07.21-17.23.02.log (28.8 KB)

These are from saved/logs from the project folder. You mean from project folder right ? then these are it

MyProject2-backup-2021.07.21-14.26.36.log (134.7 KB)

Last one sorry it took longer I had to edit the user name out to user x ~ towards the end I just took out the user, I don’t want people seeing my windows username. Rest is standard like on all computers I guess where instalation is. This is bigger than the others.

I can’t just paste the content of the logs here, i’ll just spam everything they have many lines.
So you got the files.

I was reading that the dlls from the start missing re not a problem and it should compile without them, the later errror says missing module.

But the module is there under source folder there is a folder named Myproject2 that is the core module.

C:\Users\User\Documents\Unreal Projects\MyProject2\Source\MyProject2

It has the:
MyClass.cpp
MyClass.h
MyProject2.Build.cs
MyProject2.cpp
MyProject2.h

Checking the log I found that you have another issue. have issue which is discussed in this link with 70+ comments. Its either ms or epics screwing with telemetry. Check the link many different solutions are suggested with some working for some and nothing working for others.
https://forums.unrealengine.com/t/prgram-cant-start-cause-api-ms-win-downlevel-kernal32-blah-blah-dll-is-missing/156022/77

vs tool chain is working now!
I still going through all the logs.

Yes but the editor starts without the dll, and I can save and restart the editor with the new project saved, as long as I don’t create a C++ class it can load my project.

It’s related to C++ this problem of mine it seems.
I have no problem saving projects and launching them back with the editor.
I can no longer load after I build a C++ class.

I installed unreal a few days ago it’s a clean install after the older one on my other drive I decided to install another one newer version.

It was missing from the system, I downloaded the dll and copied it in the system folders.
It seems windows 10 has it and I did not it does not come with windows 7 but can be installed inside win7 . It use to give an error while I loaded the editor that the dll is missing but it got past that problem and loaded the editor, now, I don’t get the error dll missing when I load unreal anymore.

Same problem the dll is installed but the problem persists. I don’t get the error anymore with dll is missing when I launch the editor but the same problem same different version or missing module error when I try to launch Myproject2

I’m thinking can it be from permissions ?

Try this Make new empty c++ project in root of D drive. Add a new unreal’s class from the editor and build from editor. and see the result.
It fails I will get and send my exact dos vstool chain install command from windows pc.

It’s not limited it has full privlages, that is why I was asking, it has read write, modify and so on.
Running Unreal as administrator with left click then run as administrator does not help either.
I can modify permissions from my user, it has admin privlages, but it’s not the main Administrator account, windows creates a default username that you give a name with administrator privlages, but also has the default administrator account that you don’t use that is in the background, shows in security tabs and so on.

But sometimes I saw some files (not related to Unreal) but other stuff where there were no users and only System had privleges and was in the security tab as a user, and the other users were missing.

I install VStudio I solve the problem lol, I bet. What an ugly deal.
I had it installed on my other drive, and it worked fine, with the same windows, same settings.
Compiled fine but it had Visual Studio.

Each time I lanuched it was a tragedy, lag, over processing , sluggish when many tabs were open to look around.

Plus the 30 days “sign in slave or don’t use it” just fills up my cup. + huge space for nothing.

Maybe someone from Unreal can help me for my troubles, lol.

How to USE Unreal without installing visual studio ide on Windows

  1. downlod visual studio build tools bootstrapper

Go to Download Visual Studio Tools - Install Free for Windows, Mac, Linux
find and download “Build Tools for Visual Studio 2019” (or direct link )

Copy that executable to any location like D:\

  1. open command prompt and go to the executable location if its D:
    cd /d D:\

  2. Download necessary components by running below command prompt.

vs_BuildTools.exe --layout D:\vs19_buildtool --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.NuGet

Note 1: There are some are extra components above which can be avoided like c#, netcore5 llvm-clang, some components of Managed desktop build (ue5 uses netcore3.1 and nuget, on ue4 even those can be removed)

Note 2: Run step 3 in the future to update the vs build tools

  1. Install by running from command prompt

D:\vs19_buildtools\vs_setup.exe --noweb --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Component.NuGet

  1. Install vscode, notepad++, QtCreator, or any other editor and enjoy coding!

Note 1: Unreal will detect the vsbuild tools automatically. You don’t need visual studio if you don’t use c++ with Unreal4-5.

Note 2: VS build tool 2019 and 2022 will work on windows 7 with all updates. But Unreal 4.26 and above is fully funtional only on windows 10 and above. In some setup even 4.25 has some issues with win7 and visual studio

Note 3: vs build tools 22 can also downloaded similarly. But Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools has changed and now individual components of that workload has to be added if you want to use it with unreal 5. Also vsbt22 has packing issue with ue5, so as it said it is better to stick with older compilers, instead of new and shiny when it comes to programming.

NB: Edited to keep up with changes from ms. For some reason ms constantly keeps chainging how such offline tools can be dowloaded and used.