cmake -A Win64 -G “Visual Studio 16 2019“ .. 错误

cmake -A Win64 -G “Visual Studio 16 2019“ ..

cmake  -G  “Visual Studio 16 2019  Win64 “ ..

使用上面两个命令构造64位系统架构的 VS 2019  sln项目时,都会出现如下错误:

PS E:\workForVS\Micro-XRCE-DDS-Agent\build> cmake  -G "Visual Studio 16 2019"  ..
CMake Error at CMakeLists.txt:122 (project):
  Failed to run MSBuild command:

    D:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe

  to get the value of VCTargetsPath:

    用于 .NET Framework 的 Microsoft (R) 生成引擎版本 16.11.2+f32259642
    版权所有(C) Microsoft Corporation。保留所有权利。

    生成启动时间为 2023/3/30/周四 15:49:23。
    节点 1 上的项目“E:\workForVS\Micro-XRCE-DDS-Agent\build\CMakeFiles\3.20.21032501-MSVC_2\VCTargetsPath.vcxproj”(默认目标)。
    D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(820,5): error : The BaseOutputPath/OutputPath property is not set for project 'VCTargetsPath.vcxproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='Win64'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [E:\workForVS\Micro-XRCE-DDS-Agent\build\CMakeFiles\3.20.21032501-MSVC_2\VCTargetsPath.vcxproj]
    已完成生成项目“E:\workForVS\Micro-XRCE-DDS-Agent\build\CMakeFiles\3.20.21032501-MSVC_2\VCTargetsPath.vcxproj”(默认目标)的操作 - 失败。

    生成失败。

    “E:\workForVS\Micro-XRCE-DDS-Agent\build\CMakeFiles\3.20.21032501-MSVC_2\VCTargetsPath.vcxproj”( 默认目标) (1) ->
    (_CheckForInvalidConfigurationAndPlatform 目标) ->
      D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(820,5): error : The BaseOutputPath/OutputPath property is not set for project 'VCTargetsPath.vcxproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='Win64'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [E:\workForVS\Micro-XRCE-DDS-Agent\build\CMakeFiles\3.20.21032501-MSVC_2\VCTargetsPath.vcxproj]

        0 个警告
        1 个错误

    已用时间 00:00:00.15


  Exit code: 1



-- Configuring incomplete, errors occurred!
See also "E:/workForVS/Micro-XRCE-DDS-Agent/build/CMakeFiles/CMakeOutput.log".

上述Visual Studio 16 2019编译错误,需要命令改为:

E:\workForVS\Micro-XRCE-DDS-Agent\build> cmake -A x64 -G "Visual Studio 16 2019"  ..

Refer: Installation — eProsima Micro XRCE-DDS 2.1.1 documentation

Visual Studio 15 2017 编译,使用如下命令:

$ cmake -G "Visual Studio 15 2017 Win64" ..
$ cmake --build .
$ cmake --build . --target install

这里64位架构使用 x64,   取代以前版本的 Win64。

# vs2019以及更新版本 已经改了
cmake -G "Visual Studio 16 2019" -A Win32
cmake -G "Visual Studio 16 2019" -A x64
cmake -G "Visual Studio 16 2019" -A ARM
cmake -G "Visual Studio 16 2019" -A ARM64

# vs2018以及以前版本 
cmake -G "Visual Studio 15 2017 Win32" 
cmake -G "Visual Studio 15 2017 Win64" 
cmake -G "Visual Studio 15 2017 ARM" 
cmake -G "Visual Studio 17 2017 ARM64" 

# https://micro-xrce-dds.docs.eprosima.com/en/latest/installation.html
$ cmake -G "Visual Studio 15 2017 Win64" ..
$ cmake --build .
$ cmake --build . --target install

DLL Export Viewer下载链接:https://www.nirsoft.net/utils/dllexp-x64.zip

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值