微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Windows安装期间,aws-cpp-sdk失败,原因是安装导出中的EXPORT“ foo-targets ... ...”多次包含目标“ foo”

如何解决Windows安装期间,aws-cpp-sdk失败,原因是安装导出中的EXPORT“ foo-targets ... ...”多次包含目标“ foo”

请我自己回答,迷失了一天,并希望为其他人省去麻烦。

设置:

您尝试类似的操作:

  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" ...) includes target "aws-c-common" more than once in the export set. [C:\Users\xyz\aws-sdk-cpp\build\.deps\AwsCCommon.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 中修复。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。