D
D
DVoropaev2017-02-12 18:40:59
Programming
DVoropaev, 2017-02-12 18:40:59

Why is libcurl not working?

compiled the code in ubuntu - everything works.
compiled the code in Windows (Windows XP, CodeBlocks) - "protocol https not supported or disabled in libcurl "
Here is the code section that uses libcurl:

int GetContent(const char * s)
{
  char errorBuffer[CURL_ERROR_SIZE];
  CURL *curl;
    CURLcode result;
    curl = curl_easy_init();
    if (curl)
    {
      curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer);
      curl_easy_setopt(curl, CURLOPT_URL, s);
      curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer);
      curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
      result = curl_easy_perform(curl);
      if (result == CURLE_OK)      
         cout << buffer << "\n";              
       else      
         cout << "Ошибка! " << errorBuffer << endl;        
  }
  curl_easy_cleanup(curl);
  return 0;
}

46f3e0242fcb4946aa346b9b8538d054.png

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry, 2017-02-12
@TrueBers

Well, compile with its support, what's the problem then?

M
Mercury13, 2017-02-13
@Mercury13

Oddly enough, you need a version of libcurl with HTTPS support.
Most of these versions need two OpenSSL files to load - libeay32.dll, ssleay32.dll.

T
Troodi Larson, 2017-04-15
@troodi

Compile lib file with open ssl
support

S
Seo5, 2021-08-09
@Seo5

There is a banal problem, nothing needs to be installed, there is a problem in quotes, look here https://saitsozdanie.ru/forum/index.php?topic=9010.0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question