AWS Developer Blog

AWS SDK for C++ Now Available via. NuGet

by Jonathan Henson | on | in C++, C++ | Permalink | Comments |  Share

C++ has long suffered from the lack of good dependency management solutions. For .NET development, NuGet is one of the most commonly used tools. NuGet solves each of these problems for the Visual Studio C++ development environment:

  • Native Windows developers often have to build against multiple Visual C++ runtimes.
  • Companies often need to distribute flavors of their binaries for each architecture.
  • Building dependency libraries from scratch is time-consuming and difficult to scale across a large enterprise.
  • Globally installed native libraries suffer from versioning problems and make dynamic linking unsafe. Thus developers end up manually sandboxing their artifacts or statically linking.
  • Distributing dynamic libraries with an application is often error prone and unsafe.

Last week, we started pushing the AWS SDK for C++ to NuGet.org as part of our release process. Let’s look at an example:

First, let’s create a simple Visual C++ Win32 Console Application. For the main function, let’s just write out “Hello World!”

We want to integrate our application with Amazon Simple Storage Service (Amazon S3). To do this, right-click the project in the Solution Explorer, and select Manage NuGet Packages.

Next, we’ll select the package to use. In this case, we’ll search the keywords aws s3 native. Alternatively, we could search for “AWSSDKCPP-S3” because each of the AWS SDK for C++ packages follow the AWSSDKCPP-<service name> naming convention.

After we have installed the package, we can simply start using it. You’ll see that IntelliSense is already updated with the new include path.

Instead of worrying about setting up linker paths for each runtime and architecture configuration, our project will just build using the correct binaries.

Finally, you’ll see how our project page is already updated with our new dependencies.

We provide prebuilt Debug and Release binaries for Visual Studio 2013 and Visual Studio 2015 to target the 32-bit and 64-bit platforms.

We hope this makes native Windows development with AWS easier and more efficient. Please feel free to leave your feedback here or on GitHub.