cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Phil Blundell <pb_at_reciva.com>
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.

p.
Received on 2009-04-05