-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
I've installed nuget package
and added lib in linker input
code:
#include "stdafx.h"
#include "LoginApi.h"
#include <cpprest/http_client.h>
LoginApi::LoginApi()
{
web::http::client::http_client client(L"https://ex.com");
web::http::http_request request;
request.headers().add(L"User-Agent", L"~");
std::stringstream ReqBody;
std::string ReqBodyS;
ReqBody << "login=" << "" << "&pass=" << "" << "&type=2";
ReqBodyS = ReqBody.str();
request.set_body(ReqBodyS);
request.set_method(web::http::methods::POST);
request.headers().set_content_type(U("application/x-www-form-urlencoded"));
client.request(request).then([](web::http::http_response response)
{
if (response.status_code() == web::http::status_codes::OK)
{
if (response.headers()[web::http::header_names::pragma].c_str()[0] != '\0')
{
~~~
}
}
else
MessageBoxA(nullptr, "Connection error!", "", MB_OK);
});
}
And i got
unresolved external symbol "public: static class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const web::http::header_names::pragma" (?pragma@header_names@http@web@@2V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@B)
Error 1 error LNK2001: unresolved external symbol "public: static class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const web::http::methods::GET" (?GET@methods@http@web@@2V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@B)
Error 2 error LNK2001: unresolved external symbol "public: static class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const web::http::methods::POST" (?POST@methods@http@web@@2V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@B)
Metadata
Metadata
Assignees
Labels
No labels