Rest 서비스에 대한 학습 과정의 일부로 Microsoft C++ REST SDK "casablanca"를 사용하여 간단한 HTTP 수신기를 작성하려고합니다. 내 목표는 처음에 localhost에서 가리키는 간단한 POST 요청을 수신하고 텍스트를 파일에 저장할 수 있는지 테스트하는 것입니다.간단한 HTTP 수신기를 구축하는 동안 VS2015의 casablanca 링커 오류
이 프로젝트는 VS2015에 구축 중입니다. 내장 된 패키지 관리자를 사용하여 sdk를 찾아서 설치하고 github에서 필요한 헤더 파일을 다운로드하여 추가 include 디렉토리로 추가했습니다.
해결되지 않은 : 구축하려고 할 때, 나는 지금까지 오류 코드 여기 LNK2019
으로 내가지고있어 오류의
#include <cpprest/http_listener.h>
#include <iostream>
#include <stdlib.h>
using namespace web;
using namespace web::http;
using namespace web::http::experimental::listener;
using namespace utility;
using namespace std;
#define TRACE(msg) wcout << msg;
#define TRACE_ACTION(a, k, v) wcout << a << L" (" << k << L", " << v << L")\n";
map<utility::string_t, utility::string_t> dictionary;
void handle_post(http_request request)
{
TRACE(L"\nhandle POST\n");
utility::string_t input;
input = request.to_string();
utility::ofstream_t out("output.txt");
out << input;
out.close();
}
int main(int argc, char** argv)
{
http_listener listener(L"http://localhost:8080");
listener.support(methods::POST, handle_post);
try
{
listener
.open()
.then([&listener]() {TRACE(L"\nstarting to listen\n"); })
.wait();
while (true);
}
catch (exception const & e)
{
wcout << e.what() << endl;
}
}
하나의 코드를 "확인되지 않은 외부 기호"오류입니다 점점 계속 외부 기호 "__declspec (같이 DllImport) 공개 : _thiscall 웹 :: URI : URI (wchar_t를의 CONST *)"(__imp _ ?? 0uri @ 웹 @@ QAE @ PB_W @ Z) function_main에 언급 된 사람이 할 수있는 경우
감사하겠습니다 내가 잘못하고있는 것을 나에게 지적한다.