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

标签 c++ visual-studio cmake aws-sdk-cpp

问这样我自己可以回答这个问题,为此浪费了一天时间,并希望为其他人省去麻烦。

设置:

  • 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++ 开发工具包的 Windows 源代码构建。从源代码的标准构建和 vcpkg 替代方案都会发生。如果您尝试构建 https://github.com/aws/aws-sdk-cpp 中提到的“第 3 方依赖项”,也会发生这种情况。手动。

你可以试试:

  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:\Users\xyz\aws-sdk-cpp\build\.deps\AwsChecksums.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"...) 在导出集中多次包含目标“aws-c-common”。 [C:\Users\xyz\aws-sdk-cpp\build\.deps\AwsCCommon.vcxproj]

最佳答案

完全不明显,但问题似乎与“cmake 3.19.0-rc1”有关。更改为 cmake 3.18.4 绕过了该问题。我不知道这是 cmake 问题还是 sdk 问题,或者我会在某人的 github 上而不是 stackoverflow 上发帖。

关于c++ - 由于安装(EXPORT "foo-targets"...)在导出集中多次包含目标 "foo",aws-cpp-sdk 在 Windows 构建期间失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64507009/

相关文章:

c++ - 在 UNIX(首选 Linux)上学习 C++ 编程的好书?

c++ - 将 .mat 文件从 MATLAB 转换为 OpenCV 中的 cv::Mat 矩阵

visual-studio - Azure Sdk for vs2013.4 不起作用

c++ - 为什么 GCC 给我一个错误 : no unique final overrider?

c++ - 如何从可执行文件中取回目标文件名

c++ - 在 CMake 中仅指定某些源文件

c++ - 如何使用 XCode 6.1 C++ Debug模式检查所有局部变量

c++ - cmake:查找/添加 Visual Studio 或 windows sdk 库和头文件的正确方法?

c++ - 错误 C2536 : cannot specify explicit initializer for arrays in Visual Studio 2013 的解决方法

C 内联程序集生成未处理的异常