cURL / Mailing Lists / curl-library / Single Mail


Re: Callback function gives crazy "size_t nmemb" value for simple http get operation (C++)

From: Phil Blundell <>
Date: Sun, 05 Apr 2009 14:26:32 +0100

On Sun, 2009-04-05 at 09:29 +0200, Kjetil Volden wrote:
> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &Book::write_html);

This is your problem; the WRITEFUNCTION expects a pointer to a C
function, not a C++ method. You need to provide a wrapper function to
interface between the C and C++ worlds, or make Book::write_html be a
static member function rather than an object method.

Received on 2009-04-05