1

I was recently working on a project to make HTTP requests in C++. I found the libcurl library with the curlpp wrapper in another StackOverflow question. But when I set it up, it tells me that options is not a member of curlpp.

#include <iostream>
#include "curlpp/cURLpp.hpp"
#include "curlpp/Options.hpp"

curlpp::Cleanup myCleanup;
std::ostringstream os;
using namespace BlaguesAPI;
int main() {
  os << curlpp::options::Url(std::string("http://youtube.com")); // Here
  return 0;
}

In my workspace folder, I added the include folder of the official .zip file available for download here.

Did I miss something?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Mr. PRAINGLE
  • 59
  • 1
  • 6
  • `options` is indeed in the `curlpp` namespace. Did you try using `#include <...>` instead of `#include "..."` for the curlpp headers? [What is the difference between #include and #include "filename"?](https://stackoverflow.com/questions/21593/) However, `curlpp::Cleanup myCleanup;` and `std::ostringstream os;` should be inside your `main()`, not in global scope. And why are you using `using namespace BlaguesAPI;` when you are not using anything from the `BlaguesAPI` namespace? – Remy Lebeau Jul 01 '22 at 00:11
  • For BlaguesAPI i deleted the code that didn't matter here, I just forgot this line. I moved `curlpp::Cleanup myCleanup;` and `std::ostringstream os;` to my `main()` but nothing changed. And the reason why I'm using `#include "..."` and not `#include <...>` is because I use `curlpp` as a local folder (I can't manage to run c++ on VSCode so I use [replit](https://repl.it)) – Mr. PRAINGLE Jul 01 '22 at 08:52

0 Answers0