I want to develop a small application which uses some libraries. So I downloaded them and placed the include files in a folder called include
.
For my application, I used cpprestsdk, but my question shouldn't be limited only to this library.
This is a rough example of my folder Structure:
myproject include cpprest ... pplx ... test.cpp
And this is my Code:
#include <iostream>#include "include/cpprest/http_client.h"#include "include/cpprest/filestream.h"#include "include/cpprest/json.h"int main() { // code std::cout << "Hello World!"; return 0;}
which results in followin error code when compiling (g++ test.cpp -o test
) with g++ or gcc (on Ubuntu):
<error needed>
What have I done wrong? when I inspect the file mentioned in the error message, then I notice, that all includes in the library are like so #include "cpprest/asyncrt_utils.h"
. As you can see, it refers to the file as it were in a subfolder called cpprest
, which it is not. It is located with the other file in the same folder. I guess that results in my problem. My question now is: how do I fixe this issue?