C++ REST SDK 遇到的链接错误

幻灵小龙 2017-06-14 09:54:51

wstring strClient(_server);
strClient.append(L"/getprojectinfobyudid.api");
http_client_config clientConfig;
clientConfig.set_timeout(utility::seconds(5)); // 设置超时时间
http_client client(strClient, clientConfig);

如上示例代码,当添加http_client_config这个参数时,就会出现
引用
error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall web::details::win32_encryption::~win32_encryption(void)" (__imp_??1win32_encryption@details@web@@QAE@XZ),该符号在函数 "public: __thiscall web::credentials::~credentials(void)" (??1credentials@web@@QAE@XZ) 中被引用


已经正确安装了Rest SDK包并引用了头文件和namespace。
当使用http_client client(strClient);是没任何问题的,我已经正常使用好几天了。因为我要设置超时时间,就多加了个http_client_config参数,变成http_client client(strClient, clientConfig);之后,就出现这个链接问题了。
在网上搜索了一下,发现这个网页的最底部有个解决方案,但看不懂。
引用
to resolve the linking errors related to “compression” define CPPREST_EXCLUDE_COMPRESSION when building

https://katyscode.wordpress.com/2014/04/01/how-to-statically-link-the-c-rest-sdk-casablanca/

求解,谢谢!
...全文
165 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧