Announcement

Collapse
No announcement yet.

C4800: Implicit conversion from 'T' to bool - Compile error when using VS2019

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    C4800: Implicit conversion from 'T' to bool - Compile error when using VS2019

    I recently forked and cloned the latest release branch that updates the engine to 4.22 and I'm noticing that there are several errors when attempting to build the engine via VS2019. I'm getting lots of Implicit conversion from 'T' to bool errors that fail the building process. I've attached a picture that might help as reference.

    If I build the engine with VS2017, everything works fine. But if I build with VS2017, I can't then use VS2019 as my primary editor for projects - changing the VS version in the Editor Preferences and trying to create and run a C++ project just forces a recompile of the engine, so then I get the same errors as above.

    Is anyone else having this problem when building in VS2019? Does anyone have a fix? Thanks for any help.

    #2
    I can confirm this is happening!

    For me, started after I changed my source code editor to Visual Studio 2019.

    Comment


      #3
      A temporary fix for this issue is to add the following line of code to VCToolChain.cs line 485 inside of the UnrealBuildTool and recompile it, then recompile the engine.

      Code:
      Arguments.Add("/wd4800"); // 4800: Implicit conversion from 'type' to bool. Possible information loss
      Last edited by looter; 04-03-2019, 11:32 AM.

      Comment


        #4
        That seems to have solved the build issues, and I'm able to successfully compile a 4.22 version of the engine. That said, whenever I go to try and create a C++ project, it wants to rebuild the engine from scratch. I'm just going to go back to VS2017 until the issues with this are resolved, I think.

        Comment


          #5
          The error persists in the launcher version too (which makes sense), so you can't recompile the engine. Needs a fix asap.

          Comment


            #6
            It's funny because I didn't receive this error while I had VS 2019 installed side-by-side with VS 2017. I could use VS 2019 to build, open, and play my project no problem last night. But this morning I uninstalled VS 2017 and rebooted, after which I started getting this error.

            Either way, thanks for the fix. I can confirm that updating VCToolChain.cs as shown lets the engine compile successfully.

            Comment


              #7
              Like vigiliant said above the engine wants a full build everytime I compiled. I compiled source with temp fix you guys mentioned. Made a blank thirdperson c++ project. Switched to compiled version and did full compile. Did touch a thing and did build(went to do full rebuild) and I made sure I just did regular build. Apparently this is an issue with vs2019 and 2017. I never upgraded to 2017 for this issue and it seems 2019 wants to do this as well. Anyone have a fix for it?? Not trying to change subject its because temp fixes above work its more like an add on question lol

              Comment


                #8
                I think the issue is if you have a custom editor target with code, it will trigger a full rebuild each compile due to a bug with the UHT. The fix for us was to simply remove our no-longer needed editor module code, and just setup a blank target similar to ShooterGame.
                Last edited by looter; 04-04-2019, 08:17 AM.

                Comment


                  #9
                  Any news on this one? I have the same issue since I installed VS 2019, and I can't get anything to work anymore. It always tries to build the whole engine

                  Comment


                    #10
                    Can confirm VS2019 wants to re-parse the makelist and rebuild UE4.sln ( when VS2017 uninstalled ) ... after the DEPRECATION arg is added for wd4800 . UE4.sln did build . Retargeting SDK etc no change. sorry if not clear .. Expect to require a sln for just the engine . and yes UnrealBuildTool needs to build first . Hopefully someone out there can fix ... I'm new to this engine development but not to C or C# or C++ ... maybe we are stuck in VS2017 ... but the SDK change alone no good . VS2019 is good in other deveopment areas ... with some conformance compiler changes needed for old C or C++ ...

                    Comment


                      #11
                      This needs attention please ... source release would need a change .

                      Comment


                        #12
                        With regards to the compiler error, it seems that it will be fixed in version 4.22.1 (https://github.com/EpicGames/UnrealEngine/pull/5752). For now, the only way to bypass that is by adding the argument like looter mentioned.

                        Comment


                          #13
                          I'm also getting the constant rebuild issue. Has anyone figured out a fix? I do have a custom editor target, but it is just straight out of ShooterGame.

                          Comment


                            #14
                            Originally posted by DaneBrick View Post
                            With regards to the compiler error, it seems that it will be fixed in version 4.22.1 (https://github.com/EpicGames/UnrealEngine/pull/5752). For now, the only way to bypass that is by adding the argument like looter mentioned.
                            That PR is rejected, epic actually adopts mine https://github.com/EpicGames/UnrealEngine/pull/5572, which submitted on Feb, 22.

                            Comment


                              #15
                              I still get this error.
                              Use last UE4.22 from source. VS2019 Community. Windows Education N from March 2020(also tried "Windows Home N").

                              D:\programs\VS\2019\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h(311): error C4800: Implicit conversion from 'ADODB::_Recordset *const ' to bool. Possible information loss
                              D:\programs\VS\2019\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h(311): note: consider using explicit cast or comparison to nullptr to avoid this warning
                              D:\programs\VS\2019\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h(310): note: while compiling class template member function '_com_ptr_t<_com_IIID<ADODB::_Recordset,& _GUID_00001556_0000_0010_8000_00aa006d2ea4>>:perator bool(void) noexcept const'
                              D:\programs\UnrealEngine-4.22\Engine\Plugins\Runtime\Database\ADOSupport\Source\ADOSupport\Private\ADOSupport.cpp(255): note: see reference to function template instantiation '_com_ptr_t<_com_IIID<ADODB::_Recordset,& _GUID_00001556_0000_0010_8000_00aa006d2ea4>>:perator bool(void) noexcept const' being compiled
                              D:\programs\UnrealEngine-4.22\Engine\Plugins\Runtime\Database\ADOSupport\Intermediate\Build\Win64\UE4Editor\Development\ADOSupport\msado15.tli(1813): note: see reference to class template instantiation '_com_ptr_t<_com_IIID<ADODB::_Recordset,& _GUID_00001556_0000_0010_8000_00aa006d2ea4>>' being compiled
                              D:\programs\VS\2019\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h(311): error C4800: Implicit conversion from 'ADODB::_Connection *const ' to bool. Possible information loss
                              D:\programs\VS\2019\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h(311): note: consider using explicit cast or comparison to nullptr to avoid this warning
                              D:\programs\VS\2019\VC\Tools\MSVC\14.25.28610\INCLUDE\comip.h(310): note: while compiling class template member function '_com_ptr_t<_com_IIID<ADODB::_Connection,& _GUID_00001550_0000_0010_8000_00aa006d2ea4>>:perator bool(void) noexcept const'

                              Comment

                              Working...
                              X