curl-library
Debugging libcurl
Date: Fri, 11 Jan 2008 11:53:01 +0100
I'm using sample Code from the Website and I'm trying to debug that code. If
I try to dereference and watch a variable called "http_handle" (typ: CURL),
I get this error: "Attempt to dereference a generic pointer."
I'm compiling with the "-g" flag and I build my library with "-enable-debug
-with-ssl". I'm using GDB.
What is wrong?
Regards, O. W.
-------------------------------------------------------
Code:
#include <stdio.h>
#include <string.h>
#include <iostream>
/* somewhat unix-specific */
// #include <sys/time.h>
// #include <unistd.h>
/* curl stuff */
#include "curl/curl.h"
/*
* Simply download two HTTP files!
*/
int main(int argc, char **argv)
{
CURL *http_handle;
CURL *http_handle2;
CURLM *multi_handle;
int still_running; /* keep number of running handles */
http_handle = curl_easy_init();
http_handle2 = curl_easy_init();
/* set options */
if(http_handle)
{
curl_easy_setopt(http_handle, CURLOPT_URL,
"http://www.xxx.eu/");
}
if(http_handle2)
{
curl_easy_setopt(http_handle2, CURLOPT_URL,
"http://www.xxx.eu/");
}
/* init a multi stack */
multi_handle = curl_multi_init();
/* add the individual transfers */
curl_multi_add_handle(multi_handle, http_handle);
curl_multi_add_handle(multi_handle, http_handle2);
... tbc
Received on 2008-01-11