Get the Amazon SDK for C++ from a package manager - Amazon SDK for C++
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Get the Amazon SDK for C++ from a package manager

Important

If you are using a package manager like homebrew or vcpkg:

After updating the SDK for C++ to a new version, you must recompile any library or executable that depends on the SDK.

To set up the Amazon SDK for C++, you can either build the SDK yourself directly from the source or download the libraries using a package manager.

The SDK source is separated into individual packages by service. Installing the entire SDK can take up to an hour. Installing only the specific subset of services that your program uses decreases installation time and also reduces size on disk. To choose which services to install, you need to know the package name of each service your program uses. You can see the list of package directories at aws/aws-sdk-cpp on GitHub. The package name is the suffix of the directory name for the service.

aws-sdk-cpp\aws-cpp-sdk-<packageName> # Repo directory name and packageName aws-sdk-cpp\aws-cpp-sdk-s3 # Example: Package name is s3

Prerequisites

You need a minimum of 4 GB of RAM to build some of the larger Amazon clients. The SDK might fail to build on Amazon EC2 instance types t2.micro, t2.small, and other small instance types due to insufficient memory.

Linux/macOS

To use the Amazon SDK for C++ on Linux/macOS, you need one of the following:

  • GNU Compiler Collection (GCC) 4.9 or later, or

  • Clang 3.3 or later.

Windows

To use the Amazon SDK for C++ on Windows, you need one of the following:

  • Microsoft Visual Studio 2015 or later,

  • GNU Compiler Collection (GCC) 4.9 or later, or

  • Clang 3.3 or later.

Get the SDK using vcpkg

Important

The available vcpkg distribution is supported by external contributors and is not provided through Amazon. The most recent version is always available through installing from source.

vcpkg is a package manager updated and maintained by external contributors. Note that this package manager is not provided through Amazon and may not reflect the latest available version for the Amazon SDK for C++. There is a delay between when a version is released by Amazon and when it is available through an external package manager. The most recent version is always available through installing from source.

You must install vcpkg on your system.

  • Download and bootstrap vcpkg by following the instructions on the vcpkg GitHub Readme, substituting the following options when prompted:

    • As part of those instructions, you are guided to enter:

      .\vcpkg\vcpkg install [packages to install]

      To install the entire SDK, enter .\vcpkg\vcpkg install "aws-sdk-cpp[*]" --recurse or indicate only specific services of the SDK to install by appending a package name in brackets, for example, .\vcpkg\vcpkg install "aws-sdk-cpp[s3, ec2]" --recurse

    The output displays a messages including the following:

    CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake"
  • Copy the complete -DCMAKE_TOOLCHAIN_FILE command to use for CMake later. The vcpkg GitHub Readme also instructs on where to use this for your toolset.

  • You may also need to note the build configuration type that you installed via vcpkg. The console output shows the build configuration and the version of the SDK. The following example output indicates the build configuration is "x86-windows" and the Amazon SDK for C++ version installed is 1.8.

    The following packages will be built and installed: aws-sdk-cpp[core,dynamodb,kinesis,s3]:x86-windows -> 1.8.126#6

After you install the Amazon SDK for C++, you can develop your own application using the SDK. The "Hello, S3" starter application reports the Amazon S3 buckets you own.