Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-10236

[/std:c++latest][MSVC] Mesos failed to build due to error C2440 with /std:c++latest on Windows using MSVC

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • master
    • None
    • build
    • VS 2019 + Windows Server 2016

    Description

      Hi All,

      We tried to build Mesos on Windows with VS2019. It failed to build due to error C2440 with /std:c++latest on Windows using MSVC. It can be reproduced on latest reversion 97d9a40 on master branch. Could you please take a look at this isssue? Thanks a lot!

      Reproduce steps:

      1. git clone https://github.com/apache/mesos F:\apache\mesos
      2. Open a VS 2019 x64 command prompt as admin and browse to F:\apache\mesos
      3. mkdir build_amd64 && pushd build_amd64
      4. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DENABLE_LIBEVENT=1 -DHAS_AUTHENTICATION=0 -DPATCHEXE_PATH="F:\tools\gnuwin32\bin" -T host=x64 ..
      5. set CL= /std:c++latest /Zc:char8_t-
      6. set CL= /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING %CL%
      7. msbuild /maxcpucount:4 /p:Platform=x64 /p:Configuration=Debug Mesos.sln /t:Rebuild

      error:
      F:\gitP\apache\mesos\build_amd64\3rdparty\protobuf-3.5.0\src\protobuf-3.5.0\src\google\protobuf\compiler\objectivec\objectivec_helpers.cc(618,1): error C2440: 'return': cannot convert from 'int' to 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'
      F:\gitP\apache\mesos\build_amd64\3rdparty\protobuf-3.5.0\src\protobuf-3.5.0\src\google\protobuf\compiler\objectivec\objectivec_helpers.cc(746,1): error C2440: 'return': cannot convert from 'int' to 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'
      F:\gitP\apache\mesos\build_amd64\3rdparty\protobuf-3.5.0\src\protobuf-3.5.0\src\google\protobuf\compiler\objectivec\objectivec_helpers.cc(818,1): error C2440: 'return': cannot convert from 'int' to 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'F:\gitP\apache\mesos\build_amd64\CMakeFiles\c2387485d1f3dbc1b6a74fd6bcbf1c42\protobuf-3.5.0-mkdir.rule;F:\gitP\apache\mesos\build_amd64\CMakeFiles\c2387485d1f3dbc1b6a74fd6bcbf1c42\protobuf-3.5.0-download.rule;F:\gitP\apache\mesos\build_amd64\CMakeFiles\c2387485d1f3dbc1b6a74fd6bcbf1c42\protobuf-3.5.0-update.rule;F:\gitP\apache\mesos\build_amd64\CMakeFiles\c2387485d1f3dbc1b6a74fd6bcbf1c42\protobuf-3.5.0-patch.rule;F:\gitP\apache\mesos\build_amd64\CMakeFiles\c2387485d1f3dbc1b6a74fd6bcbf1c42\protobuf-3.5.0-configure.rule;F:\gitP\apache\mesos\build_amd64\CMakeFiles\c2387485d1f3dbc1b6a74fd6bcbf1c42\protobuf-3.5.0-build.rule;F:\gitP\apache\mesos\build_amd64\CMakeFiles\c2387485d1f3dbc1b6a74fd6bcbf1c42\protobuf-3.5.0-install.rule;F:\gitP\apache\mesos\build_amd64\CMakeFiles\391b5defe1e7774ea47783fbd33671f6\protobuf-3.5.0-complete.rule;F:\gitP\apache\mesos\build_amd64\CMakeFiles\3e040e27eb7e35ec141c0982bf4a7993\protobuf-3.5.0.rule;F:\gitP\apache\mesos\3rdparty\CMakeLists.txt' exited with code 1.

      Attachments

        1. build.log
          893 kB
          QuellaZhang

        Issue Links

          Activity

            People

              Unassigned Unassigned
              QuellaZhang QuellaZhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: