main.cpp: In function ‘void downloadFile(const string&, const string&, std::ostream&)’:
main.cpp:23:95: error: no matching function for call to ‘Aws::S3::S3Client::S3Client(Aws::Auth::AWSCredentials, Aws::Client::ClientConfiguration&)’ Aws::S3::S3Client s3Client(Aws::Auth::AWSCredentials(ACCESS_KEY, SECRET_KEY), clientConfig);
In file included from main.cpp:3:
install/include/aws/s3/S3Client.h:100:9: note: candidate: ‘Aws::S3::S3Client::S3Client(const std::shared_ptrAws::Auth::AWSCredentialsProvider&, const Aws::Client::ClientConfiguration&, Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy, bool, Aws::S3::US_EAST_1_REGIONAL_ENDPOINT_OPTION)’
S3Client(const std::shared_ptrAws::Auth::AWSCredentialsProvider& credentialsProvider, install/include/aws/s3/S3Client.h:100:9: note: candidate expects 5 arguments, 2 provided
#include <aws/lambda-runtime/runtime.h>
#include <aws/core/Aws.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/GetObjectRequest.h>
#include <aws/core/auth/AWSCredentials.h>
#include <aws/core/client/ClientConfiguration.h>
//#include <aws/core/auth/AWSCredentialsProvider.h>
using namespace aws::lambda_runtime;
Aws::SDKOptions options;
static const char* ENDPOINT_URL = "endpoint";
static const char* ACCESS_KEY = "accesskey";
static const char* SECRET_KEY = "secretkey";
void downloadFile(const std::string& bucketName, const std::string& objectKey, std::ostream& outputStream) {
Aws::Client::ClientConfiguration clientConfig;
clientConfig.endpointOverride = ENDPOINT_URL;
clientConfig.scheme = Aws::Http::Scheme::HTTP;
clientConfig.connectTimeoutMs = 30000;
clientConfig.requestTimeoutMs = 30000;
clientConfig.region = "us-west-2";
Aws::S3::S3Client s3Client(Aws::Auth::AWSCredentials(ACCESS_KEY, SECRET_KEY), clientConfig);
}