英文:
Construct build error for MakeShared in AWS S3 SDK
问题
AWS SDK CPP连接/授权S3时的构造函数错误(Xcode)
我在使用MakeShared构造函数时遇到了错误。AWS文档并未明确说明原因。
英文:
AWS SDK CPP constructor error when trying to connect/auth with S3 (Xcode)
I am getting error an on the MakeShared constructor. The AWS documentation isn’t really shining a light as to why.
Showing Recent Messages
/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
得分: 1
已修复,SDK与C++20不兼容,切换编译器为GNU++17。
英文:
Fixed, SDK not compat with C++20, switched compiler to GNU++17
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论