cURL / Mailing Lists / curl-library / Single Mail

curl-library

Newbie Darwin Question

From: Dean Shavit <Dean_at_macworkshops.com>
Date: Tue, 15 Aug 2006 01:53:18 -0500

I'm planning on writing a command-line tool for Darwin that uses
libcurl and I am having a little trouble getting the "handle" from
the curl_easy_init() function.

Here's the code as I had it from the tutorial:

#include <stdio.h>
#include <curl/curl.h>
#include <curl/easy.h>

int main (void) {
     // insert code here...

CURL *handle;
CURLcode res;
handle = curl_easy_init();
if(handle) {
curl_easy_setopt(handle, CURLOPT_URL, "curl.haxx.se");
res = curl_easy_perform(handle);

/* always cleanup */
curl_easy_cleanup(handle);
}
return 0;
}

Building this in Xcode results in the following error:

curltest has exited due to signal 6 (SIGABRT).
[Session started at 2006-08-15 01:45:36 -0500.]
ZeroLink: unknown symbol '_curl_easy_init'

The following doesn't have the Zerolink error
but naturally complains:

main.c:10: error: 'handle' undeclared (first use in this function)

#include <stdio.h>
#include <curl/curl.h>
#include <curl/easy.h>

int main (void) {
     // insert code here...

CURL *curl_easy_init();
CURLcode res;
handle = curl_easy_init();
if(handle) {
curl_easy_setopt(handle, CURLOPT_URL, "curl.haxx.se");
res = curl_easy_perform(handle);

/* always cleanup */
curl_easy_cleanup(handle);
}
return 0;
}

Can anyone help me get a *handle* on this problem? :-O

Dean Shavit
Dean_at_macworkshops.com
http://www.macworkshops.com
General Partner
MOST (Mac OS Training)
Tel: 773-506-2100
Fax: 773-506-9323

Macworkshops Training Schedule: http://macworkshops.com/most/shed.html
Affordable Web Hosting & Email - Apple Certified System Administrator
Macintosh IT Training - Windows-Mac-Linux-Novell Internetworking
Custom on-site training solutions – NetSuite Solution Provider
Received on 2006-08-15