私は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\build\native\include
追加のライブラリディレクトリ<project_dir>\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.9.1\lib
を含める私はここで、実際のスクリーンショットを追加しました。これを修正するには?
#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
(私もVisual Studioの2017,2013と試みたが、結果は同じである。)。
はい。その公式ページのチュートリアルは間違っています。私は間違いだと思う。私はそれを固定したので感謝します – Nwn