Skip to content

aws/aws-sdk-cpp

Repository files navigation

AWS SDK for C++

The AWS SDK for C++ provides a modern C++ (version C++ 11 or later) interface for Amazon Web Services (AWS). It is meant to be performant and fully functioning with low- and high-level SDKs, while minimizing dependencies and providing platform portability (Windows, OSX, Linux, and mobile).

AWS SDK for C++ is now in General Availability and recommended for production use. We invite our customers to join the development efforts by submitting pull requests and sending us feedback and ideas via GitHub Issues.

Jump To:

Getting Started

Building the SDK:

Minimum Requirements:

  • Visual Studio 2015 or later
  • OR GNU Compiler Collection (GCC) 4.9 or later
  • OR Clang 3.3 or later
  • 4GB of RAM (required for building some of the larger clients; SDK build may fail on EC2 instance types t2.micro, t2.small, and other small instance types due to insufficient memory)
  • Supported platforms
    • Amazon Linux
    • Windows
    • Mac

Building From Source:

To create an out-of-source build:

  1. Install CMake and the relevant build tools for your platform. Ensure these are available in your executable path.

  2. Clone this repository with submodules

    git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
  3. Create your build directory. Replace <BUILD_DIR> with your build directory name:

  4. Build the project:

    cd <BUILD_DIR>
    cmake <path-to-root-of-this-source-code> \
    -DCMAKE_BUILD_TYPE=Debug \
    -DCMAKE_INSTALL_PREFIX=<path-to-install> \
    -DBUILD_ONLY="s3"
    cmake --build . --config=Debug
    cmake --install . --config=Debug

    NOTE: BUILD_ONLY is an optional flag used to list only the services you are using. Building the whole SDK can take a long time. Also, check out the list of CMake parameters

Other Dependencies:

To compile in Linux, you must have the header files for libcurl, libopenssl. The packages are typically available in your package manager.

Debian based Linux distributions example: sudo apt-get install libcurl-dev

RPM based Linux distributions example: sudo [yum|dnf|zypper] install libcurl-devel

Building for MacOS

Building for macOS is largely the same as building on a *nix system except for how the system consumes the curl dependency and compilers.

You must install the xcode command line tools. This is required for Apple clang and gcc. This also installs libcurl as well.

⚠️ If you are using macOS Sonoma, there is a known issue where using libcurl version 8.4.0 on macOS can lead to issues. This issue is being tracked with curl and Apple. In the meanwhile, please use an updated version of curl from Homebrew. You can include this in your project via the CMAKE_PREFIX_PATH.

cmake -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/curl/" \
 -DAUTORUN_UNIT_TESTS=OFF \
 -DBUILD_ONLY="s3" \
 -DCMAKE_INSTALL_PREFIX="~/sdk-install" \
 ..

Building for Android

To build for Android, add -DTARGET_ARCH=ANDROID to your CMake command line. Currently, we support Android APIs from 19 to 28 with Android NDK 19c, and we are using the built-in CMake toolchain file supplied by Android NDK, assuming you have the appropriate environment variables (ANDROID_NDK) set.

Android on Windows

Building for Android on Windows requires some additional setup. In particular, you will need to run CMake from a Visual Studio developer command prompt (2015 or higher). Additionally, you will need 'git' and 'patch' in your path. If you have Git installed on a Windows system, then the patch is likely found in a sibling directory (.../Git/usr/bin/). Once you've verified these requirements, your CMake command line will change slightly to use nmake:

cmake -G "NMake Makefiles" `-DTARGET_ARCH=ANDROID` <other options> ..

Nmake builds targets in a serial fashion. To make things quicker, we recommend installing JOM as an alternative to nmake and then changing the CMake invocation to:

cmake -G "NMake Makefiles JOM" `-DTARGET_ARCH=ANDROID` <other options> ..

Building aws-sdk-cpp - Using vcpkg

You can download and install aws-sdk-cpp using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install aws-sdk-cpp

The aws-sdk-cpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Maintenance and support for SDK major versions

For information about maintenance and support for SDK major versions and our underlying dependencies, see the following in the AWS SDKs and Tools Shared Configuration and Credentials Reference Guide

Getting Help

The best way to interact with our team is through GitHub. You can open a discussion for guidance questions or an issue for bug reports or feature requests.

You may also find help on community resources such as StackOverFlow with the tag #aws-sdk-cpp. If you have a support plan with AWS Support, you can also create a new support case.

Please make sure to check out our resources too before opening an issue:

Using the SDK and Other Topics