4

I'm trying to run c++ windows application using casablanca 'c++ rest sdk' for REST requests. I've created new 'CLR Empty Project' (visual studio 2012) and added new item - 'Windows Form'. added some code and was able to see a form when running the projects. now, I have installed the c++ rest sdk using NuGet, as the instructions tell. it all went successfully. the problem is that in order to use the 'c++ rest sdk' I've added these:

#include <cpprest/http_client.h>
#include <cpprest/filestream.h> 

and it doesn't find those files. I'm getting

fatal error C1083: Cannot open include file: 'cpprest/http_client.h': No   such file or directory

Project screenshot: project screenshot

thanks!

LogicStuff
  • 19,397
  • 6
  • 54
  • 74
user2880391
  • 2,683
  • 7
  • 38
  • 77

3 Answers3

6

you have to include this path :

C:\YourProject\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.8.0\build\native\include

and:

C:\YourProject\packages\cpprestsdk.v140.windesktop.msvcstl.dyn.rt-dyn.2.8.0\lib

I've got the same issue after I added the NuGet package. The include and lib folders are not linked automatically as the description says.

5

Check if you have set up the include directories for the headers. You can do it under project properties -> Configuration Properties -> C/C++ -> General -> Additional Include Directories.

Goshutu
  • 132
  • 10
  • it's empty. when clicking 'edit' I see empty list and "Inherit from parent..." is checked. what supposed to be there? – user2880391 Apr 15 '15 at 20:56
  • 1
    You have to add the directory where the "cpprest" folder is. That way, the compiler would know where to search for cpprest/http_client.h. The #include searches in the additional include directories, and the #include "xxxxx.h" searches in the current project directory only. – Goshutu Apr 15 '15 at 21:07
  • thanks. it actually helped. but then I ran into other problem. thanks anyway. – user2880391 Apr 16 '15 at 18:20
  • In case a user is using Qt as a development environment, you need to add the path to the "cpprestsdk_xx-XX" in your .pro file for both "include" and "lib" folder of "cpprestsdk" or to your properties file in case you are using any other development env. – Srijan Chaudhary May 26 '20 at 04:57
0

I have faced the same problems like you. Even i set my project properties manually, i could see linking errors.

And i could find an article on their official forum.

https://casablanca.codeplex.com/discussions/644534

Yes, we've removed VS 2012 binaries from the package. I recommend trying out VS 2015 community, which can be downloaded for free from: https://www.visualstudio.com/downloads/download-visual-studio-vs.

I have tested it on the same way on VS2015 community IDE. The package is working perfectly.

  • and also you have to notice that they are not offering static libraries. therefore, your application is needed to be set 'MD/MDd'. – Seung-Min Jung Sep 28 '16 at 21:17