<bdo id='7R9RC'></bdo><ul id='7R9RC'></ul>
      <i id='7R9RC'><tr id='7R9RC'><dt id='7R9RC'><q id='7R9RC'><span id='7R9RC'><b id='7R9RC'><form id='7R9RC'><ins id='7R9RC'></ins><ul id='7R9RC'></ul><sub id='7R9RC'></sub></form><legend id='7R9RC'></legend><bdo id='7R9RC'><pre id='7R9RC'><center id='7R9RC'></center></pre></bdo></b><th id='7R9RC'></th></span></q></dt></tr></i><div id='7R9RC'><tfoot id='7R9RC'></tfoot><dl id='7R9RC'><fieldset id='7R9RC'></fieldset></dl></div>
      1. <small id='7R9RC'></small><noframes id='7R9RC'>

        <tfoot id='7R9RC'></tfoot>

      2. <legend id='7R9RC'><style id='7R9RC'><dir id='7R9RC'><q id='7R9RC'></q></dir></style></legend>

        CMake:无法运行 MSBuild 命令:MSBuild.exe

        CMake: failed to run MSBuild command: MSBuild.exe(CMake:无法运行 MSBuild 命令:MSBuild.exe)
        • <legend id='SZmeK'><style id='SZmeK'><dir id='SZmeK'><q id='SZmeK'></q></dir></style></legend>

          <small id='SZmeK'></small><noframes id='SZmeK'>

            <bdo id='SZmeK'></bdo><ul id='SZmeK'></ul>
                <tbody id='SZmeK'></tbody>

              <tfoot id='SZmeK'></tfoot>
                  <i id='SZmeK'><tr id='SZmeK'><dt id='SZmeK'><q id='SZmeK'><span id='SZmeK'><b id='SZmeK'><form id='SZmeK'><ins id='SZmeK'></ins><ul id='SZmeK'></ul><sub id='SZmeK'></sub></form><legend id='SZmeK'></legend><bdo id='SZmeK'><pre id='SZmeK'><center id='SZmeK'></center></pre></bdo></b><th id='SZmeK'></th></span></q></dt></tr></i><div id='SZmeK'><tfoot id='SZmeK'></tfoot><dl id='SZmeK'><fieldset id='SZmeK'></fieldset></dl></div>

                  本文介绍了CMake:无法运行 MSBuild 命令:MSBuild.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 Windows 10 上使用 CMake GUI 构建 FIAT.

                  I am trying to build FIAT using CMake GUI on windows 10.

                  CMake Error at CMakeLists.txt:3 (project):
                    Failed to run MSBuild command:
                  
                      MSBuild.exe
                  
                    to get the value of VCTargetsPath:
                  Configuring incomplete, errors occurred!
                  

                  我将 CMake 配置为使用 Visual Studio 15 2017 编译器.

                  I configured CMake to use Visual Studio 15 2017 compiler.

                  我该如何解决这个问题?

                  How can I fix this?

                  如果需要,这里是 CMakeLists.txt 文件

                  If needed, here is the CMakeLists.txt file

                  cmake_minimum_required(VERSION 3.2)
                  include(CheckCXXCompilerFlag)
                  project(FIAT CXX)
                  
                  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
                  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
                  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
                  
                  if(CHECK_CXX_COMPILER_USED1)
                  # Using Visual Studio C++
                  elseif("${CMAKE_CXX_COMPILER_ID}x" STREQUAL "MSVCx")
                  # Using Intel C++
                  elseif("${CMAKE_CXX_COMPILER_ID}x" STREQUAL "Intelx")
                  else(CHECK_CXX_COMPILER_USED1)
                      # GCC or Clang
                      # At least C++11
                      CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
                      CHECK_CXX_COMPILER_FLAG("-std=c++1z" COMPILER_SUPPORTS_CXX1Z)
                      CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
                      CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)
                      CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
                      if(COMPILER_SUPPORTS_CXX17)
                          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
                      elseif(COMPILER_SUPPORTS_CXX1Z)
                          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z")
                      elseif(COMPILER_SUPPORTS_CXX14)
                          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
                      elseif(COMPILER_SUPPORTS_CXX1Y)
                          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
                      elseif(COMPILER_SUPPORTS_CXX11)
                          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
                      else(COMPILER_SUPPORTS_CXX17)
                          message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
                      endif(COMPILER_SUPPORTS_CXX17)
                  
                      if(CHECK_CXX_COMPILER_USED2)
                      elseif("${CMAKE_CXX_COMPILER_ID}x" MATCHES "Clangx")
                          # Using Clang
                          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-global-constructors")
                      elseif("${CMAKE_CXX_COMPILER_ID}x" STREQUAL "GNUx")
                          # Using GCC
                          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
                      endif(CHECK_CXX_COMPILER_USED2)
                  endif(CHECK_CXX_COMPILER_USED1)
                  
                  #OpenCV
                  FIND_PACKAGE(OpenCV REQUIRED core imgproc highgui imgcodecs)
                  if(OpenCV_Found)
                      INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIR})
                  endif(OpenCV_Found)
                  
                  #Boost
                  FIND_PACKAGE(Boost REQUIRED program_options filesystem)
                  if(Boost_FOUND)
                      INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
                  else(Boost_FOUND)
                      set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:/local/boost_1_60_0/")
                      set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:/local/boost_1_60_0/lib64-msvc-14.0")
                      Find_PACKAGE(Boost)
                      if(Boost_FOUND)
                          INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
                      endif(Boost_FOUND)
                  endif(Boost_FOUND)
                  
                  set(Boost_USE_STATIC_LIBS        OFF)
                  set(Boost_USE_MULTITHREADED      ON)
                  set(Boost_USE_STATIC_RUNTIME     OFF)
                  set(BOOST_ALL_DYN_LINK           OFF)
                  
                  # Annotation Lib
                  file(GLOB_RECURSE FIAT_LIB_HEADERS
                      "${FIAT_SOURCE_DIR}/src/image/*.h" "${FIAT_SOURCE_DIR}/src/annotation/*.h" "${FIAT_SOURCE_DIR}/src/tools/*.h"
                  )
                  
                  file(GLOB_RECURSE FIAT_LIB_SRC
                      "${FIAT_SOURCE_DIR}/src/image/Image.cpp" "${FIAT_SOURCE_DIR}/src/annotation/*.cpp" "${FIAT_SOURCE_DIR}/src/tools/*.cpp"
                  )
                  
                  add_library(utilities ${INCLUDE_DIRECTORIES} ${FIAT_LIB_HEADERS} ${FIAT_LIB_SRC})
                  target_link_libraries (utilities ${Boost_LIBRARIES} ${OpenCV_LIBRARIES} )
                  
                  if(CHECK_CXX_COMPILER_USED_UTILITIES)
                  
                  elseif("${CMAKE_CXX_COMPILER_ID}x" STREQUAL "MSVCx")
                    # using Visual Studio C++
                  elseif("${CMAKE_CXX_COMPILER_ID}x" STREQUAL "Intelx")
                    # using Intel C++
                  else()
                    # GCC or Clang
                      target_link_libraries (utilities m )
                  endif(CHECK_CXX_COMPILER_USED_UTILITIES)
                  
                  # Annotate
                  file(GLOB_RECURSE FIAT_ANNOTATE_HEADERS
                  )
                  
                  file(GLOB_RECURSE FIAT_ANNOTATE_SRC
                      "${FIAT_SOURCE_DIR}/src/app/annotate.cpp"
                  )
                  
                  add_executable(annotate ${INCLUDE_DIRECTORIES} ${FIAT_LIB_HEADERS} ${FIAT_ANNOTATE_HEADERS} ${FIAT_ANNOTATE_SRC})
                  target_link_libraries(annotate utilities ${Boost_LIBRARIES} ${OpenCV_LIBRARIES})
                  
                  
                  if(CHECK_CXX_COMPILER_USED_ANNOTATE)
                  elseif("${CMAKE_CXX_COMPILER_ID}x" STREQUAL "MSVCx")
                    # using Visual Studio C++
                  elseif("${CMAKE_CXX_COMPILER_ID}x" STREQUAL "Intelx")
                    # using Intel C++
                  else()
                    # GCC or Clang
                      target_link_libraries (annotate m)
                  endif(CHECK_CXX_COMPILER_USED_ANNOTATE)
                  

                  根据您的建议,我尝试从 Developer Command Prompt for VS2015 构建,但仍然出现以下错误:

                  As per your recommendation, I tried building from the Developer Command Prompt for VS2015 but still got the following error:

                  msbuild FIAT.vcxproj /p:configuration=debug
                  Microsoft (R) Build Engine version 14.0.25420.1
                  Copyright (C) Microsoft Corporation. All rights reserved.
                  
                  Build started 6/12/2017 5:16:26 AM.
                  Project "E:WorkFastImageAnnotationTool-masterFIAT.vcxproj" on node 1 (default targets).
                  E:WorkFastImageAnnotationTool-masterFIAT.vcxproj(1,1): error MSB4067: The element <#text> beneat
                  h element <Project> is unrecognized.
                  Done Building Project "E:WorkFastImageAnnotationTool-masterFIAT.vcxproj" (default targets) -- FA
                  ILED.
                  
                  
                  Build FAILED.
                  
                  "E:WorkFastImageAnnotationTool-masterFIAT.vcxproj" (default target) (1) ->
                    E:WorkFastImageAnnotationTool-masterFIAT.vcxproj(1,1): error MSB4067: The element <#text> bene
                  ath element <Project> is unrecognized.
                  
                      0 Warning(s)
                      1 Error(s)
                  
                  Time Elapsed 00:00:00.03
                  

                  这是我项目的 .vcxproj 文件

                  <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  
                    <ItemGroup>  
                      <ProjectConfiguration Include="Debug|Win32">  
                        <Configuration>Debug</Configuration>  
                        <Platform>Win32</Platform>  
                      </ProjectConfiguration>  
                      <ProjectConfiguration Include="Release|Win32">  
                        <Configuration>Release</Configuration>  
                        <Platform>Win32</Platform>  
                      </ProjectConfiguration>  
                    </ItemGroup>  
                    <Import Project="$(VCTargetsPath)Microsoft.Cpp.default.props" />  
                    <PropertyGroup>  
                      <ConfigurationType>Application</ConfigurationType>  
                      <PlatformToolset>v120</PlatformToolset>  
                    </PropertyGroup>  
                    <Import Project="$(VCTargetsPath)Microsoft.Cpp.props" />  
                    Annotation.cpp Annotations.cpp app/annotate.cpp - image/Image.cpp test/image-test.cpp - tools/tools.cpp
                  
                    <ItemGroup>  
                      <ClInclude Include="/src/annotation/Annotation.cpp" />  
                    </ItemGroup>  
                    <ItemGroup>  
                      <ClInclude Include="/src/annotation/Annotation.h" />  
                    </ItemGroup>  
                  
                    <ItemGroup>  
                      <ClInclude Include="/src/annotation/Annotations.cpp" />  
                    </ItemGroup>  
                    <ItemGroup>  
                      <ClInclude Include="/src/annotation/Annotation.h" />  
                    </ItemGroup>  
                  
                    <ItemGroup>  
                      <ClInclude Include="/src/app/annotate.cpp" />  
                    </ItemGroup>  
                  
                    <ItemGroup>  
                      <ClInclude Include="/src/image/Image.cpp" />  
                    </ItemGroup>  
                    <ItemGroup>  
                      <ClInclude Include="/src/image/Image.h" />  
                    </ItemGroup>
                  
                    <ItemGroup>  
                      <ClInclude Include="/src/test/image-test.cpp" />  
                    </ItemGroup> 
                  
                    <ItemGroup>  
                      <ClInclude Include="/src/tools/tools.cpp" />  
                    </ItemGroup>  
                    <ItemGroup>  
                      <ClInclude Include="/src/tools/tools.h" />  
                    </ItemGroup> 
                  
                    <Import Project="$(VCTargetsPath)Microsoft.Cpp.Targets" />  
                  </Project>  
                  

                  推荐答案

                  The error reading a missing Path to MSBuild.exe

                  The error reads a missing Path to MSBuild.exe

                  可能的解决方案是安装 MSBuild.exe

                  The possible solution to this is to install MSBuild.exe

                  向下滚动到其他工具和框架,然后安装Visual Studio 构建工具

                  这篇关于CMake:无法运行 MSBuild 命令:MSBuild.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?(静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么?)
                  How do I load a C DLL from the SXS in Python?(如何从 Python 中的 SXS 加载 C DLL?)
                  Can Cython code be compiled to a dll so C++ application can call it?(Cython 代码可以编译成 dll 以便 C++ 应用程序可以调用它吗?)
                  Delay Loading DLLs(延迟加载 DLL)
                  Throwing C++ exceptions across DLL boundaries(跨 DLL 边界抛出 C++ 异常)
                  Loading a dll from a dll?(从 dll 加载 dll?)

                        <tbody id='BiQ7R'></tbody>
                    • <tfoot id='BiQ7R'></tfoot>
                    • <legend id='BiQ7R'><style id='BiQ7R'><dir id='BiQ7R'><q id='BiQ7R'></q></dir></style></legend>

                      • <bdo id='BiQ7R'></bdo><ul id='BiQ7R'></ul>
                        <i id='BiQ7R'><tr id='BiQ7R'><dt id='BiQ7R'><q id='BiQ7R'><span id='BiQ7R'><b id='BiQ7R'><form id='BiQ7R'><ins id='BiQ7R'></ins><ul id='BiQ7R'></ul><sub id='BiQ7R'></sub></form><legend id='BiQ7R'></legend><bdo id='BiQ7R'><pre id='BiQ7R'><center id='BiQ7R'></center></pre></bdo></b><th id='BiQ7R'></th></span></q></dt></tr></i><div id='BiQ7R'><tfoot id='BiQ7R'></tfoot><dl id='BiQ7R'><fieldset id='BiQ7R'></fieldset></dl></div>

                          <small id='BiQ7R'></small><noframes id='BiQ7R'>