cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem libcurl, no output on console

From: Alberto Glarey <alglare_at_tin.it>
Date: Sat, 27 May 2006 11:17:00 +0200

Brian Dessent wrote:
> Alberto Glarey wrote:
>
>
>>#include "stdio.h"
>>#include "curl/curl.h"
>
>
> You should use < > and not " " here.
>
>
>>if(curl!=NULL){res=curl_easy_setopt(curl,CURLOPT_URL,"http://www.google.com");}
>>
>>else{printf("error\n");};
>>
>>curl_easy_cleanup(curl);
>>
>>return 0;
>>}
>>-----
>>
>>im compilig with the following line :
>>
>>gcc -o main main.c `curl-config --cflags --libs`
>>
>>i get no errors while compiling.
>>running the program i get no errors, but i have NO output on console.
>
>
> You never call curl_easy_perform, which means that this program doesn't
> actually do anything. Maybe you should look at the examples that come
> with libcurl.
>
> Brian
>

thank you for quick response .

it's my fault, i forgot to call the curl_easy_perform(...) function .

adding the line:

res = curl_easy_perform(curl);

all works correctly .

sorry for waste your time.

Alberto Glarey
Received on 2006-05-27