[UE4]Engine Source Compilation Issues Collection
Keywords: UE4, VS 2019 building from source failed
VS 2019
fatal error C1083 Cannot open include file ‘typeinfo.h’
Issue:
Building from engine source failed:
fatal error C1083: Cannot open include file: 'typeinfo.h': No such file or directory
Caused by:
It’s a issue of version 4.22.
https://issues.unrealengine.com/issue/UE-81677
Solution:
replace #include <typeinfo.h>
with #include <typeinfo>
, no .h
.
error C4800: Implicit conversion from ‘ADODB::_Recordset *const ' to bool. Possible information loss
Error on building source:
error C4800: Implicit conversion from 'ADODB::_Recordset *const ' to bool. Possible information loss
error C4800: Implicit conversion from 'EnvDTE::Thread *const ' to bool. Possible information loss
Caused by:
Type checking at compilation time is more strict in VS 2019.
Solution:
Add Arguments.Add("/wd4800");
in Engine\Source\Programs\UnrealBuildTool\Platform\Windows\VCToolChain.cs
.
void AppendCLArguments_CPP(CppCompileEnvironment CompileEnvironment, List<string> Arguments)
{
if (Target.WindowsPlatform.Compiler != WindowsCompiler.Clang)
{
// Explicitly compile the file as C++.
Arguments.Add("/TP");
Arguments.Add("/wd4800");
Reference:
https://stackoverflow.com/questions/60943495/error-compiling-unreal-engine-4-24-1-after-updating-visual-studio-2019
https://blog.csdn.net/maxiaosheng521/article/details/95196841
Or:
Modify engine source:
https://github.com/EpicGames/UnrealEngine/commit/25cefc81fe24c767eb995b0bb66b5611e0596973?diff=unified
LogCompile : error : Failed to initialize the engine (PreInit failed).
Error on building source:
2>C:\MyProj\Intermediate\ProjectFiles\LogCompile(0,0): Error : Failed to initialize the engine (PreInit failed).
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(46,5): Error MSB3073 : The command "C:\Windows\System32\chcp.com 65001 >NUL
E:\UnrealEngine\Engine\Build\BatchFiles\Build.bat -Target="StarsEditor Win64 DebugGame -Project=\"C:\MyProj\MyProj.uproject\"" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 3.
Solution:
Delete all intermediate files in Plugins
directory.
Man is the cruelest animal. ― Friedrich Nietzsche