aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.96k stars 1.05k forks source link

Does not build using VS 2022 #2846

Closed zdenko-s closed 7 months ago

zdenko-s commented 7 months ago

Describe the bug

Build of cmake generated project fails

Expected Behavior

Build succeeds

Current Behavior

Running cmake to generate VS projects

cmake.exe --no-warn-unused-cli -DCMAKE_BUILD_TYPE="[Debug | Release]" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -H".\aws-sdk-cpp" -G"Visual Studio 17 2022" -B"cmake_gen_dir\x64lib" -T host=x64 -A x64 -DBUILD_ONLY="s3;transcribe;transfer;s3-crt" -DENABLE_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DFORCE_SHARED_CRT=OFF

Open generated solution and try to build project aws-cpp-sdk-core. Compile time error:

aws-sdk-cpp\src\aws-cpp-sdk-core\source\utils\event\EventEncoderStream.cpp(31,17): error C2220: the following warning is treated as an error 14>C:\temp\build_aws_cpp_sdk_1.11\aws-sdk-cpp\src\aws-cpp-sdk-core\source\utils\event\EventEncoderStream.cpp(31,17): warning C4834: discarding return value of function with [[nodiscard]] attribute

Reproduction Steps

Run cmake and specify VS 2022 as generator.

cmake.exe --no-warn-unused-cli -DCMAKE_BUILD_TYPE="[Debug | Release]" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -H".\aws-sdk-cpp" -G"Visual Studio 17 2022" -B"cmake_gen_dir\x64lib" -T host=x64 -A x64 -DBUILD_ONLY="s3;transcribe;transfer;s3-crt" -DENABLE_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DFORCE_SHARED_CRT=OFF

Build generated solution either using msbuild (command line) or Visual Studio

Possible Solution

No response

Additional Information/Context

cmake output

-- TARGET_ARCH not specified; inferring host OS to be platform compilation target -- Building AWS libraries as static objects -- Generating windows build config -- Building project version: 1.11.258 -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045. -- The CXX compiler identification is MSVC 19.38.33134.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done

AWS CPP SDK version used

1.11.258

Compiler and Version used

Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.8.4

Operating System and version

Windows 10

sbiscigl commented 7 months ago

We can work at getting a fix out, which should be out soon, but if you want a quick work around you can set warnings as errors to off -DAWS_SDK_WARNINGS_ARE_ERRORS=OFF

sbiscigl commented 7 months ago

merged, will be released today

jmklix commented 7 months ago

This was fixed with this PR. Please let us know if you're seeing any other build issues on windows with this sdk

github-actions[bot] commented 7 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.