# UnrealEngine failed to build due to error C4800: Implicit conversion from 'int32' to bool. Possible information loss on x64 with MSVC

**URL:** <https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 6, 2019, 1:25pm UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702 "2019-03-06T13:25:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_f8849df7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f8849df7](https://forums.unrealengine.com/u/anonymous_user_f8849df7)\
**Post date:** [March 6, 2019, 1:25pm UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/1 "2019-03-06T13:25:38Z")

</div>

Environment:  
VS 2017 + Windows Server 2016

Issue description:  
UnrealEngine failed to build due to error C4800: ‘‘Implicit conversion from ‘int32’ to bool. Possible information loss’’ on x64 with MSVC. This issue can be reproduced on commit 0697cef on UE Github Master branch.Could you please help take a look at this? Thank you!

Steps to Reproduce:

1. git clone [https://github.com/EpicGames/UnrealEngine](https://github.com/EpicGames/UnrealEngine) D:\UnrealEngine\src
2. Open a VS 2017 x64 command prompt and browse to D:\UnrealEngine
3. cd src
4. Setup.bat
5. GenerateProjectFiles.bat
6. .\Engine\Build\BatchFiles\Rebuild.bat UE4Editor Win64 Development -waitmutex -verbose

link text

Actual result:  
D:\UnrealEngine\src\Engine\Source\Runtime\Renderer\Private\DeferredShadingRenderer.cpp(945): error C4800: Implicit conversion from ‘int32’ to bool. Possible information loss  
D:\UnrealEngine\src\Engine\Source\Runtime\Renderer\Private\RayTracing\RayTracingGlobalIllumination.cpp(345): error C4800: Implicit conversion from ‘int32’ to bool. Possible information loss  
D:\UnrealEngine\src\Engine\Source\Runtime\Renderer\Private\RayTracing\RayTracingReflections.cpp(258): error C4800: Implicit conversion from ‘T’ to bool. Possible information loss  
with  
[  
T=int32  
]  
D:\UnrealEngine\src\Engine\Source\Runtime\Renderer\Private\RayTracing\RayTracingReflections.cpp(258): note: consider using explicit cast or comparison to 0 to avoid this warning  
D:\UnrealEngine\src\Engine\Source\Runtime\Renderer\Private\RayTracing\RayTracingReflections.cpp(258): note: see declaration of ‘T’  
D:\UnrealEngine\src\Engine\Source\Editor\MeshPaintMode\Private\PaintModeSettingsCustomization.cpp(374): error C4800: Implicit conversion from ‘int32’ to bool. Possible information loss  
D:\UnrealEngine\src\Engine\Plugins\FX\Niagara\Source\NiagaraEditor\Private\NiagaraCompiler.cpp(620): error C4800: Implicit conversion from ‘int32’ to bool. Possible information loss  
D:\UnrealEngine\src\Engine\Plugins\FX\Niagara\Source\NiagaraEditor\Private\NiagaraCompiler.cpp(771): error C4800: Implicit conversion from ‘int32’ to bool. Possible information loss

---

<div class="post-metadata">

**Author:** ![Jeff\_A](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jeff\_A](https://forums.unrealengine.com/u/Jeff_A)\
**Post date:** [March 6, 2019, 6:51pm UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/2 "2019-03-06T18:51:19Z")

</div>

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

[https://epicsupport.force.com/unrealengine/s/](https://epicsupport.force.com/unrealengine/s/)

Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f8849df7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f8849df7](https://forums.unrealengine.com/u/anonymous_user_f8849df7)\
**Post date:** [March 7, 2019, 8:15am UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/3 "2019-03-07T08:15:04Z")

</div>

Thanks for your reply!

I’ve reported as you provided new link: [Unreal Engine Community](https://epicsupport.force.com/unrealengine/s/) . But only show your case has been submitted. No return ticket number, we can not find this issue ticket.

Thanks,

---

<div class="post-metadata">

**Author:** ![TriNityGER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/trinityger/32/477231_2.png) [@TriNityGER](https://forums.unrealengine.com/u/TriNityGER)\
**Post date:** [April 4, 2019, 10:07pm UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/4 "2019-04-04T22:07:30Z")

</div>

Did anything change regarding this issue? It still persists in the 4.22 branch!

---

<div class="post-metadata">

**Author:** ![Miheev2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Miheev2](https://forums.unrealengine.com/u/Miheev2)\
**Post date:** [April 7, 2019, 7:08am UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/5 "2019-04-07T07:08:58Z")

</div>

I installed vs 2019 and get the same problem! I can not compile the engine!

---

<div class="post-metadata">

**Author:** ![Sarlack](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sarlack/32/1194542_2.png) [@Sarlack](https://forums.unrealengine.com/u/Sarlack)\
**Post date:** [April 7, 2019, 5:41pm UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/6 "2019-04-07T17:41:45Z")

</div>

I don’t see this on the issues page either. I would like to up-vote because I have the same problem building with 4.22 release and vs2019. I did get a successful build at first when I opened the version 15 (2017) sln file in vs2019 because it seem to still use the vs2017 toolchain. But when I “GeneratedProjectFiles -2019” to get the correct sln file for vs2019 which uses the 2019 toolchain I get the error.

---

<div class="post-metadata">

**Author:** ![Sarlack](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sarlack/32/1194542_2.png) [@Sarlack](https://forums.unrealengine.com/u/Sarlack)\
**Post date:** [April 7, 2019, 9:09pm UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/7 "2019-04-07T21:09:32Z")

</div>

I am using 4.22 Release, Visual Studio 2019 and Windows10 and got the same error. I see you are using a different Environment, but this may help until Epic Devs can help/fix. I found a link to a tutorial that solved the errors for me.  
[link text](https://horugame.com/unreal-engine-4-22-with-visual-studio-2019/)  
When I added the two arguments to the VCToolChain.cs file after line 484 I got it to build without errors.

```
Arguments.Add("/wd4800");
Arguments.Add("/wd5038");

```

Since your in a different environment, I’m not sure if the this will help or if the code line will be in the same location.  
Also beware that the quote marks in the tutorial need to be corrected to straight quotes " " because they are curly quotes “ ” , if you copy/paste them from the webpage into the VCToolChain.cs file you may get an error.

---

<div class="post-metadata">

**Author:** ![Miheev2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Miheev2](https://forums.unrealengine.com/u/Miheev2)\
**Post date:** [April 8, 2019, 4:19am UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/8 "2019-04-08T04:19:06Z")

</div>

The version of the MSVS 4.20 does not work, the return is up to 4.16 problems.

 ![273619-2019-04-07-15-29-32.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/e/1de44b6ff20309d67bd50814b03ad729a2f20576.png)

---

<div class="post-metadata">

**Author:** ![chris-gong](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chris-gong/32/1106462_2.png) [@chris-gong](https://forums.unrealengine.com/u/chris-gong)\
**Post date:** [April 22, 2019, 4:31pm UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/9 "2019-04-22T16:31:07Z")

</div>

I’m going to post Sarlack’s comment as an answer because I’m sure that is the correct answer. Essentially, you have to suppress these compiler warnings by going into the `VCToolChain.cs` file located at the file path, `Engine\Source\Programs\UnrealBuildTool\Platform\Windows`. And after line 484, just add these two lines,

`Arguments.Add("/wd4800");`

`Arguments.Add("/wd5038");`

c4800 is the code for the compiler warning,

> [Implicit conversion from ‘type’ to bool. Possible information loss](https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4800?view=vs-2019)

c5038 is the code for the compiler warning,

> [data member ‘member1’ will be initialized after data member ‘member2’ data member ‘member’ will be initialized after base class ‘base\_class’](https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2019)

**UPDATE**

This will be resolved in 4.22.1. [https://github.com/EpicGames/UnrealEngine/pull/5752](https://github.com/EpicGames/UnrealEngine/pull/5752)

---

<div class="post-metadata">

**Author:** ![Trout\_Zhang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Trout\_Zhang](https://forums.unrealengine.com/u/Trout_Zhang)\
**Post date:** [June 4, 2019, 7:15pm UTC](https://forums.unrealengine.com/t/unrealengine-failed-to-build-due-to-error-c4800-implicit-conversion-from-int32-to-bool-possible-information-loss-on-x64-with-msvc/444702/10 "2019-06-04T19:15:20Z")

</div>

Check my PR on Feb, 22

[https://github.com/EpicGames/UnrealEngine/pull/5572](https://github.com/EpicGames/UnrealEngine/pull/5572)

I fixed it when I got vs 2019 preview 3, and the PR is merged by epic in 4.22.1 already on Apr, 5.
