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

Mesos failed to build due to error LNK2019: unresolved external symbol "int __cdecl os::execvp(char const *,char * const * const)" on windows with MSVC

    XMLWordPrintableJSON

Details

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

    Description

      Hi All,

      We tried to build Mesos on Windows with VS2019. It failed to build due to error LNK2019: unresolved external symbol "int __cdecl os::execvp(char const *,char * const * const)" on Windows using MSVC. It can be reproduced on latest reversion 0a6cf76 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.git F:\apache\mesos

      2. Apply the following four patches(patches in attachment)

       

         mesos_c2664_bug837166.patch

         mesos_disable_w4601_libarchive.patch

         mesos_c2668.patch (fix F:\apache\mesos\src\slave\containerizer\mesos\launch.cpp(524,34): error C2668: 'os::spawn': ambiguous call to
      overloaded function)

         mesos_c1083.patch (fix error C1083: Cannot open include file: 'csi/state.pb.h' and Cannot open include file: "re2/re2.h".  Reference to  https://issues.apache.org/jira/browse/MESOS-10182)

      3. Open a VS 2019 x64 command prompt as admin and browse to F:\apache\mesos

      4. mkdir build_amd64 && pushd build_amd64

      5. 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 ..

      6. set CL=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING

      7. msbuild /maxcpucount:4 /p:Platform=x64 /p:Configuration=Debug Mesos.sln /t:Rebuild

       

      Note: mesos_build.log in attachment.

       

      ErrorMessage:

      104>mesos.lib(launch.obj) : error LNK2019: unresolved external symbol "int __cdecl os::execvp(char const *,char * const * const)" (?execvp@os@@YAHPEBDQEBQEAD@Z) referenced in function "protected: virtual int __cdecl mesos::internal::slave::MesosContainerizerLaunch::execute(void)" (?execute@MesosContainerizerLaunch@slave@internal@mesos@@MEAAHXZ) [F:\apache\mesos\build_amd64\src\launcher\mesos-executor.vcxproj]

      104>mesos.lib(launch.obj) : error LNK2019: unresolved external symbol "int __cdecl os::execvpe(char const *,char * *,char * *)" (?execvpe@os@@YAHPEBDPEAPEAD1@Z) referenced in function "protected: virtual int __cdecl mesos::internal::slave::MesosContainerizerLaunch::execute(void)" (?execute@MesosContainerizerLaunch@slave@internal@mesos@@MEAAHXZ) [F:\apache\mesos\build_amd64\src\launcher\mesos-executor.vcxproj]

      104>F:\apache\mesos\build_amd64\src\mesos-executor.exe : fatal error LNK1120: 2 unresolved externals [F:\apache\mesos\build_amd64\src\launcher\mesos-executor.vcxproj]

      103>mesos.lib(csi_server.obj) : error LNK2019: unresolved external symbol "public: __cdecl mesos::csi::Metrics::Metrics(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Metrics@csi@mesos@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: __cdecl mesos::internal::slave::CSIServerProcess::CSIPlugin::CSIPlugin(class mesos::CSIPluginInfo const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0CSIPlugin@CSIServerProcess@slave@internal@mesos@@QEAA@AEBVCSIPluginInfo@4@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) [F:\apache\mesos\build_amd64\src\cli\mesos-execute.vcxproj]

      103>mesos.lib(csi_server.obj) : error LNK2019: unresolved external symbol "public: __cdecl mesos::csi::Metrics::~Metrics(void)" (1Metrics@csi@mesos@@QEAA@XZ) referenced in function "int `public: __cdecl mesos::internal::slave::CSIServerProcess::CSIPlugin::CSIPlugin(class internal::CSIPluginInfo const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)'::`1'::dtor$4" (?dtor$4@?0?0CSIPlugin@CSIServerProcess@slave@internal@mesos@@QEAA@AEBVCSIPluginInfo@4@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z@4HA) [F:\apache\mesos\build_amd64\src\cli\mesos-execute.vcxproj]

      Attachments

        1. mesos_build.log
          1.60 MB
          QuellaZhang
        2. mesos_c1083.patch
          1 kB
          QuellaZhang
        3. mesos_c2664_bug837166.patch
          2 kB
          QuellaZhang
        4. mesos_c2668.patch
          0.9 kB
          QuellaZhang
        5. mesos_disable_w4601_libarchive.patch
          0.8 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: