C++ RESTAPI를 사용하는 프로젝트에서 작업하고 있습니다. 임 Casablanca 자습서에 따라 제공됩니다. 이 튜토리얼에 따르면, NuGet 패키지 관리자를 사용하여 C++ 프로젝트에 Casablanca를 추가했습니다. Visual Studio 2015 Enterprise Edition을 사용하고 있습니다. 그러나 다음 파일을 포함하면 #include <cpprest/ws_client>
에 오류가 표시됩니다. 이미 다음과 같이 추가 포함 디렉토리와 추가 라이브러리 디렉토리 양식 프로젝트 등록 정보를 설정했습니다. 추가 포함 파일을 열 수 없습니다 : 'cpprest/ws_client': 해당 파일이나 디렉토리가 없습니다.
내가 여기에 실제 스크린 샷을 추가
<project_dir>\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.9.1\lib
디렉토리<project_dir>\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.9.1\build\native\include
추가 라이브러리 디렉토리를 포함합니다. 이 문제를 해결하는 방법?
#include <iostream>
#include <cpprest/http_client.h>
#include <cpprest/filestream.h>
#include <cpprest/http_listener.h> // HTTP server
#include <cpprest/json.h> // JSON library
#include <cpprest/uri.h> // URI library
#include <cpprest/ws_client> // WebSocket client
#include <cpprest/containerstream.h> // Async streams backed by STL containers
#include <cpprest/interopstream.h> // Bridges for integrating Async streams with STL and WinRT streams
#include <cpprest/rawptrstream.h> // Async streams backed by raw pointer to memory
#include <cpprest/producerconsumerstream.h> // Async streams for producer consumer scenarios
using namespace utility; // Common utilities like string conversions
using namespace web; // Common features like URIs.
using namespace web::http; // Common HTTP functionality
using namespace web::http::client; // HTTP client features
using namespace concurrency::streams; // Asynchronous streams
using namespace web::http::experimental::listener; // HTTP server
using namespace web::experimental::web_sockets::client; // WebSockets client
using namespace web::json; // JSON library
는 (나는 또한 비주얼 스튜디오 2017,2013과 노력하지만 결과는 동일합니다.).
당신은 헤더 파일 권리를 포함하지 않는
예. 그 공식 페이지 튜토리얼은 잘못되었습니다. 나는 그것이 실수라고 생각한다. 고마워. 고맙다. – Nwn