0

I've used Nuget to install the AWS SDK for C++. My build works fine but when I try to run I get a missing Dll message. I either have to add the Dll path or copy it to my output directory but the source path is C:\Users\Tom\Documents\Bitbucket\nos\MyApp\Builds\packages\AWSSDKCPP-Transfer.redist.1.4.34\build\native\bin\Win32\Debug\v141\dynamic\aws-cpp-sdk-transfer.dll which seems ridiculous. I can't find a simpler way of doing this with Nuget for C++.

Someone suggested I use Vcpkg instead. Is it any better than Nuget or will I have the same problem?

For reference Setting Up the AWS SDK for C++

parsley72
  • 8,449
  • 8
  • 65
  • 98

2 Answers2

1

Should I install AWS SDK for C++ with Nuget or Vcpkg?

You could use nuget to install AWS SDK for C++ project.

But you should use AWSSDKCPP-service name to add a library for a particular service to your project rather than install the Redistributable components AWSSDKCPP-Transfer.redist.

When you check the description of nuget package AWSSDKCPP-Transfer.redist, you will find this nuget package:

Redistributable components for package 'AWSSDKCPP-Transfer'. This package should only be installed as a dependency. (This is not the package you are looking for).

enter image description here

So you should install the nuget package AWSSDKCPP-Transfer.

After install the nuget package AWSSDKCPP-Transfer, then build the project, the correct binaries are automatically included for each runtime/architecture configuration you use—you won't need to manage these dependencies yourself.

The aws-cpp-sdk-transfer.dll, aws-cpp-sdk-s3.dll and aws-cpp-sdk-core.dll are copied to the output directory:

enter image description here

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • The Star Wars reference made me giggle ;-) – YePhIcK Apr 30 '18 at 10:15
  • I added AWSSDKCPP-Transfer but when I run my app it says aws-cpp-sdk-transfer.dll is missing. This is only found in the AWSSDKCPP-Transfer.redist directory. I don't have a task 'Copy' like your screenshot shows - was this added automatically for you? Can you look under Property Pages->Build Events to see if it's there? – parsley72 May 06 '18 at 00:24
0

I realised the problem is that in our unit test we set Build Events->Post-Build Event->Command Line to "$(ProjectDir)"RunTestExe.bat $(QTDIR) "$(TargetDir)$(TargetFileName)" so it runs the unit tests once they're built. If I remove this Nuget correctly copies the Dlls over when debugging. I'm guessing it's using the same field. This seems like a bug that needs to be fixed so I've raised it with Microsoft: https://developercommunity.visualstudio.com/content/problem/245884/nuget-doesnt-handle-dependencies-for-debugging.html

parsley72
  • 8,449
  • 8
  • 65
  • 98