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