i need to install cpr, a library for c++, but give me some errors.
I have tried to include the downloaded folder from github, but when I try to run the code, it give me an error:
main.cpp:2:10: fatal error: cpr/cpr.h: No such file or directory
2 | #include <cpr/cpr.h>
| ^~~~~~~~~~~
compilation terminated.
My code:
#include <iostream>
#include <cpr/cpr.h>
using namespace std;
int main() {
cpr::Response r = cpr::Get(cpr::Url{"http://www.httpbin.org/get"},
cpr::Parameters{{"hello", "world"}});
cout << r.url << std::endl; // http://www.httpbin.org/get?hello=world
cout << r.text << std::endl;
return 0;
}
Project folders:
C:.
├───.vscode
└───cpr
├───.github
│ └───workflows
├───cmake
├───cpr
│ └───CMakeFiles
│ └───3.21.2
├───include
│ └───cpr
└───test
└───data
Visual studio code notice me of this errors:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\Bl4ckdestinyXX\Desktop\testcpp\main.cpp).
cannot open source file "curl/curlver.h" (dependency of "cpr/cpr.h")
How i can fix that?
PS: I'm new to C++
Thanks in advance