AWS CPP SDK:将AWSCredentials传递给S3Client

时间:2017-06-15 15:19:40

标签: c++ amazon-web-services amazon-s3 aws-sdk-cpp

static const char* AWS_ACCESS_KEY_ID = "XXXXXXXXXXXXX";
static const char* AWS_SECRET_ACCESS_KEY = "YYYYYYYYYY";
AWSCredentials credentials(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY);

上面的代码在visual studio中给出了incomplete type is not allowed的错误,导致构建错误为use of undefined type 'Aws::Auth::AWSCredentials'

请指出构建AWSCredentials对象的正确方法吗?

1 个答案:

答案 0 :(得分:0)

确保包含该类的头文件。 另外,请确保使用该类Aws::Auth::AWSCredentials的完全限定名称,或者使用using语句using namespace Aws::Auth;

声明该变量的声明之前