cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: CURLE_COULDNT_RESOLVE_HOST

From: Jakub Zakrzewski <jzakrzewski_at_e2e.ch>
Date: Mon, 2 Mar 2015 15:35:16 +0000

> Hello, I am writing because I am experiencing an issue with the curl easy perform API, I've been trying for awhile to find a solution but I've
> exhausted my resources finding anything. I have the following code in a C++ file I am writing:

> CURL *curl;
> CURLcode res;
> std::string path = "http://mywebsite.com";
> curl_easy_setopt(curl, CURLOPT_URL, path);

This is your problem. You're trying to pass std::string to C interface. It probably gets cast and you're trying to resolve some garbage.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-02