代码之家  ›  专栏  ›  技术社区  ›  Hasani

CMake“未能运行MSBUILD.exe”命令错误

  •  8
  • Hasani  · 技术社区  · 7 年前

    当我想为opencv 3.3.0创建visual studio 15(2017)make文件时,它会给我以下错误消息: error in configuration process, project files maybe invalid

    CMake Deprecation Warning at CMakeLists.txt:81 (cmake_policy):
      The OLD behavior for policy CMP0020 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.
    
    
    CMake Deprecation Warning at CMakeLists.txt:85 (cmake_policy):
      The OLD behavior for policy CMP0022 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.
    
    
    CMake Deprecation Warning at CMakeLists.txt:94 (cmake_policy):
      The OLD behavior for policy CMP0026 will be removed from a future version
      of CMake.
    
      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.
    
    
    CMake Error at CMakeLists.txt:127 (project):
      Failed to run MSBuild command:
    
        MSBuild.exe
    
      to get the value of VCTargetsPath:
    

    我使用windows 10。问题是什么?我该如何解决?

    3 回复  |  直到 7 年前
        1
  •  6
  •   kalmiya    7 年前

    在CMake gui中:在您选择了源之后&二进制文件夹并单击“配置”,它将询问您要使用哪个版本的编译器。确保选择了正确的选项

        2
  •  3
  •   Ekci    6 年前

    Windows SDK ( Windows 10 SDK )并使用运行CMake 管理员权限 若这并没有帮助,请编辑您的问题,并附上完整的警告和错误消息,就像您跳过的最重要部分一样。

        3
  •  0
  •   JoseOrtiz3    4 年前

    无论何时 cmake cmake公司 正在使用指定您尚未安装的版本。因此,要么改变 cmake公司 选项或使用所需组件(通常是Visual C++组件和Windows SDK组件)安装所需的Visual Studio版本(14.0=2015,15.0=2017,16.0=2019)。