cURL / Mailing Lists / curl-library / Single Mail

curl-library

problem using cURL (fwd)

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 17 Dec 2003 15:50:11 +0100 (CET)

(this was sent to curl-library-admin, probably by mistake)

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
---------- Forwarded message ----------
Date: Wed, 17 Dec 2003 15:48:33 +0100
From: Dev Uniways <kamel_at_uniways.fr>
Subject: problem using cURL
Dear Sir,
I would like to use cURl in my application
I used one of your example , when I try to compile my application in c
I get this error
[root_at_unilinux c]# cc test1.c -o test1
test1.c:6:36: curl/include/curl/curl.h: No such file or directory
test1.c: In function `main':
test1.c:13: `URL_FILE' undeclared (first use in this function)
test1.c:13: (Each undeclared identifier is reported only once
test1.c:13: for each function it appears in.)
test1.c:13: `handle' undeclared (first use in this function)
test1.c:53: parse error at end of input
I would like to assure your that curl.h is in curl/include/curl/
Kind regards
Charles Boudjada
my code is
===================================================================
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <stdlib.h>
#include <errno.h>
#include <curl/include/curl/curl.h>
int
 main(int argc, char *argv[])
 {
    URL_FILE *handle;
     FILE *outf;
     int nread;
    char buffer[256];
     char *url;
    if(argc < 2)
     {
         url="http://192.168.14.84/axis-cgi/jpg/image.cgi";/* default to testurl */
    }
     else
     {
       url=argv[1];/* use passed url */
     }
     /* Copy from url with fread */
     outf=fopen("image.jpg","w+");
   if(!outf)
     {
        perror("couldnt open fread output file\n");
       return 1;
    }
     handle = url_fopen(url, "r");
     if(!handle) {
         printf("couldn't url_fopen()\n");
        fclose(outf);
        return 2;
    }
     do {
        nread = url_fread(buffer, 1,sizeof(buffer), handle);
        fwrite(buffer,1,nread,outf);
     } while(nread);
    url_fclose(handle);
   fclose(outf);
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-17