简体   繁体   English

无法打开包含文件:'cpprest/ws_client':没有这样的文件或目录

[英]Cannot open include file: 'cpprest/ws_client': No such file or directory

I'm working on a project which is using C++ RESTAPI.我正在开发一个使用 C++ RESTAPI 的项目。 Im follwing Casablanca tutorial.我正在学习卡萨布兰卡教程。 According to that tutorial I added Casablanca to my C++ project using NuGet package manager.根据该教程,我使用 NuGet 包管理器将 Casablanca 添加到我的 C++ 项目中。 Im using Visual Studio 2015 Enterprise Edition.我使用的是 Visual Studio 2015 企业版。 But when Including following files it shows error on #include <cpprest/ws_client> .但是当包含以下文件时,它会在#include <cpprest/ws_client>上显示错误。 I already set the Additional Include directories, and Additional library Directories form project properties as follows.我已经设置了 Additional Include 目录和 Additional library Directories 表单项目属性,如下所示。

Additional Include Directory <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\\build\\native\\include

Additional library Directories <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\\lib

I added actual screen shots here.我在这里添加了实际的屏幕截图。 How to fix this?如何解决这个问题? 在此处输入图片说明

#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 

(I tried with visual Studio 2017,2013 also. But result is same.) (我也试过 Visual Studio 2017,2013。但结果是一样的。)

您没有正确包含头文件,因此无法解析引用:使用#include <cpprest/ws_client.h>而不是#include <cpprest/ws_client>对您#include <cpprest/ws_client>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法打开包含文件:&#39;cpprest / http_client.h&#39; - Cannot open include file: 'cpprest/http_client.h' 无法打开包含文件:&#39;QWebView&#39;:没有这样的文件或目录 - Cannot open include file: 'QWebView': No such file or directory 无法使用Qt打开包含文件:“无此文件或目录” - Cannot open include file with Qt: “No such file or directory” 无法打开包含文件:&#39;VersionHelpers.h&#39;:没有这样的文件或目录 - Cannot open include file: 'VersionHelpers.h': No such file or directory 无法打开包含文件:&#39;ctype.h&#39;:没有这样的文件或目录 - Cannot open include file: 'ctype.h': No such file or directory C1083:无法打开包含文件:…:没有这样的文件或目录? - C1083: Cannot open include file: … : No such file or directory? Qt:无法打开包含文件:&#39;QtSql&#39;:没有这样的文件或目录 - Qt : Cannot open include file: 'QtSql': No such file or directory 无法打开包含文件 - &#39;gtest.h&#39; - 没有这样的文件或目录 - Cannot open include file - 'gtest.h' - No such file or directory 错误:无法打开包含文件:“MQTTAsync.h”:没有这样的文件或目录 - Error: Cannot open include file: 'MQTTAsync.h': No such file or directory Qt 无法打开包含文件:&#39;QNetworkAccessManager&#39;:没有这样的文件或目录 - Qt Cannot open include file: 'QNetworkAccessManager': No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM