You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "clancyhuang (Jira)" <ji...@apache.org> on 2020/12/15 03:55:00 UTC

[jira] [Commented] (MESOS-10137) Mesos failed to build due to error C2668 on windows with MSVC

    [ https://issues.apache.org/jira/browse/MESOS-10137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249468#comment-17249468 ] 

clancyhuang commented on MESOS-10137:
-------------------------------------

I have a similar problem in mesos 1.11.0,the code version is 0a6cf76 on master branch

{code:java}
D:\workspace\mesos\mesos\src\slave\containerizer\mesos\launch.cpp(893): error C2668: “os::spawn”: ambiguous call to overloaded function [D:\works
pace\mesos\mesos\build\src\mesos.vcxproj]
  D:\workspace\mesos\mesos\3rdparty\stout\include\stout/os/exec.hpp(52): note: may be "Option<T> os::spawn(const std::strin
  g &,const std::vector<std::string,std::allocator<_Ty>> &)”
          with
          [
              T=int,
              _Ty=std::string
          ] (Compile the source file D:\workspace\mesos\mesos\src\slave\containerizer\mesos\launch.cpp)
  D:\workspace\mesos\mesos\3rdparty\stout\include\stout/os/windows/exec.hpp(412): note: or “Option<T> os::spawn(const
   std::string &,const std::vector<std::string,std::allocator<_Ty>> &,const Option<std::map<std::string,_Ty,std::less<_
  Ty>,std::allocator<std::pair<const _Kty,_Ty>>>> &)”
          with
          [
              T=int,
              _Ty=std::string,
              _Kty=std::string
          ] (Compile the source file D:\workspace\mesos\mesos\src\slave\containerizer\mesos\launch.cpp)
  D:\workspace\mesos\mesos\src\slave\containerizer\mesos\launch.cpp(893): note: try to match the parameter list "(const std::string, std::vecto
  r<std::string,std::allocator<_Ty>>)"
          with
          [
              _Ty=std::string
          ]
...
D:\workspace\mesos\mesos\src\slave\containerizer\mesos\launch.cpp(524): error C2668: "os::spawn": The call to overloaded function is ambiguous [D:\workspace\mesos\ mesos\build\s
rc\mesos.vcxproj]
  D:\workspace\mesos\mesos\3rdparty\stout\include\stout/os/exec.hpp(52): note: may be "Option<T> os::spawn(const std::string &,const std: :vector<st
  d::string,std::allocator<_Ty>> &)”
          with
          [
              T=int,
              _Ty=std::string
          ]
  D:\workspace\mesos\mesos\3rdparty\stout\include\stout/os/windows/exec.hpp(412): note: or “Option<T> os::spawn(const std::string &,const std
  ::vector<std::string,std::allocator<_Ty>> &,const Option<std::map<std::string,_Ty,std::less<_Ty>,std::allocator<std:: pair<const _Kty,_Ty>>>>
  &)"
          with
          [
              T=int,
              _Ty=std::string,
              _Kty=std::string
          ]
  D:\workspace\mesos\mesos\src\slave\containerizer\mesos\launch.cpp(525): note: When trying to match the parameter list "(const char [3], initializer list)"
{code}
I fixed it with the suggestions above


> Mesos failed to build due to error C2668 on windows with MSVC
> -------------------------------------------------------------
>
>                 Key: MESOS-10137
>                 URL: https://issues.apache.org/jira/browse/MESOS-10137
>             Project: Mesos
>          Issue Type: Bug
>          Components: build
>    Affects Versions: master
>            Reporter: LinGao
>            Assignee: Benjamin Mahler
>            Priority: Major
>              Labels: windows
>             Fix For: 1.11.0
>
>         Attachments: build.log
>
>
> Hi All,
> I tried to build Mesos on Windows with VS2019. It failed to build due to error C2668: 'os::spawn': ambiguous call to overloaded function on Windows using MSVC. It can be reproduced on latest reversion d4634f4 on master branch. Could you please take a look at this isssue? Thanks a lot!
>  
> Reproduce steps:
> 1.  git clone -c core.autocrlf=true [https://github.com/apache/mesos] F:\gitP\apache\mesos
>  2.  Open a VS 2019 x64 command prompt as admin and browse to F:\gitP\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_=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING %_CL_%
> 6.  msbuild /maxcpucount:4 /p:Platform=x64 /p:Configuration=Debug Mesos.sln /t:Rebuild
>  
> ErrorMessage:
> F:\gitP\apache\mesos\3rdparty\stout\include\stout/os/windows/shell.hpp(168,68): error C2668: 'os::spawn': ambiguous call to overloaded function (compiling source file F:\gitP\apache\mesos\3rdparty\libprocess\src\authenticator.cpp) [F:\gitP\apache\mesos\build_amd64\3rdparty\libprocess\src\process.vcxproj]
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)