aws-cpp-sdk 在 Windows 构建期间由于安装(导出"foo-targets"...)在导出集中多次包含目标"foo"而失败



问这样我就可以自己回答这个问题,为此损失了一天时间,并想省去其他人的麻烦。

设置:

  • Windows(在Windows 10和Server 2019上都可以看到(
  • Visual Studio(可在Visual Studio 2017和Visual Studio 2019上看到(
  • cmake 3.19.0-rc1(截至本文的最新下载(
  • 遵循上的说明https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/setup.html适用于从AWS C++SDK源代码构建的Windows。源代码标准构建和vcpkg备选方案都会发生这种情况。如果您尝试构建";第三方依赖性";在https://github.com/aws/aws-sdk-cpp手动

您可以尝试以下操作:

git clone https://github.com/aws/aws-sdk-cpp.git
cd aws-sdk-cpp
mkdir build
cd build
cmake ..

你收到来自cmake的投诉结束:

[...]
Performing configure step for 'AwsChecksums'
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
-- The C compiler identification is MSVC 19.27.29112.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
CUSTOMBUILD : CMake error : install(EXPORT "aws-checksums-targets" ...) includes target "aws-checksums" more than once in the export set. [C:Usersxyzaws-sdk-cppbuild.depsAwsChecksums.vcxproj]
-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
CMake Error at CMakeLists.txt:224 (message):
Failed to build third-party libraries.

有一条类似的线路读取CUSTOMBUILD : CMake error : install(EXPORT "aws-c-common-targets" ...) includes target "aws-c-common" more than once in the export set. [C:Usersxyzaws-sdk-cppbuild.depsAwsCCommon.vcxproj]

完全不明显,但问题似乎与"cmake 3.19.0-rc1";。更改为cmake 3.18.4绕过了这个问题。我不知道这是cmake问题还是sdk问题,或者我会在别人的github上发布,而不是stackoverflow。

我遇到了同样的问题,我发现Visual Studio 2019 16.9.1附带的CMake坏了(报告为3.19.20122902-MSVC_2的版本(。

我更改了CMake的路径,指向Vcpkg使用的路径,即3.19.2版本,现在它运行得很好。

因此,我认为该错误存在于Visual Studio附带的CMake中,并在3.19.2中修复。

最新更新