cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Curl undeclared first use in this function

From: Nick Zitzmann <nick_at_chronosnet.com>
Date: Thu, 1 Aug 2013 13:13:27 -0600

(This is a list for the curl tool. If you have libcurl questions, then they need to go to the curl-library list instead.)

On Aug 1, 2013, at 12:35 PM, mailbox20112002-SED <mailbox20112002-SED_at_yahoo.it> wrote:

> But an error showing:
> Curl1.c:74: error: `curl' undeclared (first use in this function)
> Curl1.c:74: error: (Each undeclared identifier is reported only once
> Curl1.c:74: error: for each function it appears in.)
>
>
> What could be the problem?
[…]
> int main(void) {
>
>
> CURL *pCurl;
>
> CURLcode res;
>
> FILE *fptr;
> CURLcode codes;
>
> char *url = "http://www.123.jpg";
> char outfilename[256] = "C:\\123.jpg";
>
> curl_easy_setopt(curl, CURLOPT_URL, url);

Here, and on the next two lines, the code references a variable called "curl" but does not declare it. And even if it did declare it, it would also need to be initialized, which the code is not doing. Furthermore, the code is not calling curl_global_init() at all, which is something it ought to do. What are you trying to accomplish?

Nick Zitzmann
<http://www.chronosnet.com/>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-08-01