In this guide we will be setting up and running this "Hello S3" application in Visual Studio. This was tested with Visual Studio 2022 on Windows 10, but should work on other versions. First, we will start with building this SDK in Visual Studio.
Open CMakeSettings.json by clicking on Project
and then CMake Settings for AWSSDK
(You might need to wait a few seconds for Visual Studio to generate the file)
Add the following to CMake command arguments
sh -DBUILD_ONLY="s3"
Show advanced settings
and selecting the generator that you want from the list. (Visual Studio 17 2022
works and is a decent choice if you don't know which to pick)${projectDir}\out\install\${name}
rather than the aws-sdk-cpp default on Windows of \Program Files (x86)\aws-cpp-sdk-all
.Click Save and generate CMake cache to load variables
to do the same (or press Ctrl+S on CMakeSettings.json)
ninja
), you will generate a solution file (.sln). You can then open this file as a project and complete the build and install steps from there. Before you build and install you will want to right click ALL_BUILD
in the Solution Explorer and click Set s Startup Project
Build this SDK by clicking on Build
and then Build All
Install the SDK by clicking on Build
and then Install AWSSDK
You have now successfully built and installed the aws-sdk-cpp. Now we will build and debug a "Hello S3" application.
Step 1: Write the code
from the developer guide here.Open CMakeSettings.json by clicking on Project
and then CMake Settings for hello_s3
CMake command arguments
sh -DCMAKE_PREFIX_PATH="<path to installed location from above>"
Change any other CMake settings for your project at this time, if needed.
Click Save and generate CMake cache to load variables
to do the same (or press Ctrl+S on CMakeSettings.json)
Change the startup item to hello_s3.exe
by clicking the drop-down arrow next to the green play button
Build the sample by clicking on Build
and then Build hello_s3.exe
hello_s3.exe