尝试使用S3连接/auth时AWS SDK CPP构造函数错误(Xcode)
我在MakeShared构造函数上遇到错误。AWS文档并没有真正解释为什么。
显示最近的消息
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__memory/allocator_traits.h:298:9: No matching function for call to 'construct_at'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__memory/shared_ptr.h:292:37: In instantiation of function template specialization 'std::allocator_traits<std::allocator<Aws::S3::S3Client>>::construct<Aws::S3::S3Client, std::shared_ptr<SimplifiedAWSCredentialsProvider> &, Aws::Client::ClientConfiguration &, void, void>' requested here
PTUploader::PTUploader(const std::string& access_key, const std::string& secret_key, const std::string& region)
: access_key_(access_key),
secret_key_(secret_key),
region_(region)
{
// Initialize the SDK
options_.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Debug;
Aws::Utils::Logging::InitializeAWSLogging(
Aws::MakeShared<Aws::Utils::Logging::DefaultLogSystem>(
"RunUnitTests", Aws::Utils::Logging::LogLevel::Debug, "aws_sdk_"));
Aws::InitAPI(options_);
Aws::Client::ClientConfiguration config;
config.region = region_;
// Create credentials
auto credentialsProvider = std::make_shared<SimplifiedAWSCredentialsProvider>(access_key_, secret_key_);
// Create S3 client with credentials and config
s3_client_ = std::make_shared<Aws::S3::S3Client>(credentialsProvider, config);
}
1条答案
按热度按时间8wtpewkr1#
修复SDK不兼容C20,编译器切换到GNU17