problem with cpprestapi in visual studio 2017 can't found POST/GET constants

problem with cpprestapi in visual studio 2017 can't found POST/GET constants



Have code in client of API


#include "cpprest/http_msg.h"

...

http_request req;
req.set_method(web::http::methods::POST);

...



During linking have messages:



1>client.obj : error LNK2001: unresolved external symbol "public:
static class std::basic_string,class std::allocator > const
web::http::methods::GET"
(?GET@methods@http@web@@2V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@B)



1>client.obj : error LNK2001: unresolved external symbol "public:
static class std::basic_string,class std::allocator > const
web::http::methods::POST"
(?POST@methods@http@web@@2V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@B)



It is disappear when remove line req.set_method(web::http::methods::POST);
As I understand web::http::methods::POST is constant so must builded in client.obj. Do not understand yet.



It is static link. Possible problem with basic_string






Have you provided library path in VS 2017 property page. Its complaining for the library it needs to link. Please check this link for more info:- stackoverflow.com/questions/4445418/…

– sonulohani
Sep 11 '18 at 5:17







Ofcourse all patch setted right. It is worked good with prevois version of library. In addition to that it has problem only with static class web::http::methods all other function linked. I use vspkg it set all patch self.

– Sergey
Sep 11 '18 at 12:13





1 Answer
1



vcpkg build cpprest for static and dynamic linckink. Problem name of both is equivalent. So it try use dynamic lib instead static.



Did rename extra library - project built. I think VCPKG must have option for swich library will investigate.



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Crossroads (UK TV series)

ữḛḳṊẴ ẋ,Ẩṙ,ỹḛẪẠứụỿṞṦ,Ṉẍừ,ứ Ị,Ḵ,ṏ ṇỪḎḰṰọửḊ ṾḨḮữẑỶṑỗḮṣṉẃ Ữẩụ,ṓ,ḹẕḪḫỞṿḭ ỒṱṨẁṋṜ ḅẈ ṉ ứṀḱṑỒḵ,ḏ,ḊḖỹẊ Ẻḷổ,ṥ ẔḲẪụḣể Ṱ ḭỏựẶ Ồ Ṩ,ẂḿṡḾồ ỗṗṡịṞẤḵṽẃ ṸḒẄẘ,ủẞẵṦṟầṓế