问这样我就可以自己回答这个问题,为此浪费了一天时间,并想为其他人省去麻烦。
设置:
- 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 build-from-source。从源代码和
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" ...) includes target "aws-c-common" more than once in the export set. [C:\Users\xyz\aws-sdk-cpp\build\.deps\AwsCCommon.vcxproj]