使用阿里云的oss c++ sdk出现如下错误:
1> 正在创建库 ../build/AliOss.lib 和对象 ../build/AliOss.exp
1>AliOss.obj : error LNK2001: 无法解析的外部符号 "public: class AlibabaCloud::OSS::Outcome<class AlibabaCloud::OSS::OssError,class AlibabaCloud::OSS::GetObjectResult> __thiscall AlibabaCloud::OSS::OssClient::GetObjectW(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?GetObjectW@OssClient@OSS@AlibabaCloud@@QBE?AV?$Outcome@VOssError@OSS@AlibabaCloud@@VGetObjectResult@23@@23@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z)
1>../build/AliOss.dll : fatal error LNK1120: 1 个无法解析的外部命令
2>------ 已启动生成: 项目: DemoApp, 配置: Release Win32 ------
解决方法:
#include <OssClientImpl.h> // 加上这行代码即可
#include <alibabacloud/oss/OssClient.h>