cURL / Mailing Lists / curl-library / Single Mail


Libcurl stderr

From: Francesco Garelli <>
Date: Mon, 24 Feb 2014 15:49:22 +0000


I've got few problem when trying to store debug messages in libCurl,
actually I am working
on a MFC application under Windows and I am trying to find a proper way to
the library (the connection in particular)

I did try to redirect the output in a stream that is not stderr, but as
soon as I add this line of code :

FILE *pLogFile;
if( fopen_s( &pLocalFile, "AppLog.log", "w" ))
return -1;
curl_easy_setopt(pCurlHandle, CURLOPT_STDERR, pLogFile);

The app crashes inside libcurl

I tried to change strategy, I did look at the debug sample for libcurl, the
output is a FILE*,
I gave a new file instead of the usual stderr and the app does not crash
but the output written
is minimal.

I am wondering if somebody could cast some light on what am I doing wrong,
in reality the first approach would be ok for the debug informations I need
but the app crashes.


List admin:
Received on 2014-02-24