使用官方下载的aliyun-oss-cpp-sdk-master.zip cmake 后VS2013编译lib成功。
OSS vs2013 上传文件测试通过,下载文件到本地或内存代码,报发下错误
COssUpThd.obj : error LNK2019: 无法解析的外部符号 "public: class AlibabaCloud::OSS::Outcome<class AlibabaCloud::OSS::OssError,class AlibabaCloud::OSS::GetObjectResult> __thiscall AlibabaCloud::OSS::OssClient::GetObjectA(class AlibabaCloud::OSS::GetObjectRequest const &)const " (?GetObjectA@OssClient@OSS@AlibabaCloud@@QBE?AV?$Outcome@VOssError@OSS@AlibabaCloud@@VGetObjectResult@23@@23@ABVGetObjectRequest@23@@Z),该符号在函数 "public: void __thiscall COssUpThd::GetMacList(void)" (?GetMacList@COssUpThd@@QAEXXZ) 中被引用 1>K:\短期项目\OSS备份工具\RemoteCtr\bin\MainCtr.exe : fatal error LNK1120: 1 个无法解析的外部命令
代码:取到文件,内在都上面错误 ClientConfiguration conf; OssClient client(Endpoint, AccessKeyId, AccessKeySecret, conf); std::string ObjectName = "yourObjectName";
GetObjectRequest request(BucketName, ObjectName);
//request.setVersionId("yourObjectVersionId");
auto outcome = client.GetObjectA(request);
//GetObjectOutcome GetObject(const GetObjectRequest& request) const;
//GetObjectRequest request(BucketName, ObjectName);
//request.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(FileNametoSave, std::ios_base::out | std::ios_base::in | std::ios_base::trunc | std::ios_base::binary); });
//auto outcome = client.GetObject(request);
网上说加:扔有问题
#include <OssClientImpl.h> // 加上这行代码即可 #include <alibabacloud/oss/OssClient.h> https://blog.csdn.net/friendan/article/details/90911281
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。