First command-line tool attempt
First command-line tool attempt
- Subject: First command-line tool attempt
- From: Dean Shavit <email@hidden>
- Date: Sat, 19 Aug 2006 00:07:19 -0500
My code:
#include <stdio.h>
#include <curl/curl.h>
#include <curl/easy.h>
int main (int argc, const char * argv[]) {
// 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;
}
Returns the following errors on compile:
Building target “mhm_curltest” of project “mhm_curltest” — (1 error)
cd /Users/dean/mhm_curltest
setenv MACOSX_DEPLOYMENT_TARGET 10.4
/usr/bin/gcc-4.0 -o /Users/dean/mhm_curltest/build/Debug/
mhm_curltest -L/Users/dean/mhm_curltest/build/Debug -F/Users/dean/
mhm_curltest/build/Debug -filelist /Users/dean/mhm_curltest/build/
mhm_curltest.build/Debug/mhm_curltest.build/Objects-normal/i386/
mhm_curltest.LinkFileList -arch i386 -mmacosx-version-min=10.4 -
isysroot /Developer/SDKs/MacOSX10.4u.sdk
/usr/bin/ld: Undefined symbols:
_curl_easy_cleanup
_curl_easy_init
_curl_easy_perform
_curl_easy_setopt
collect2: ld returned 1 exit status
/usr/bin/ld: Undefined symbols:
_curl_easy_cleanup
_curl_easy_init
_curl_easy_perform
_curl_easy_setopt
collect2: ld returned 1 exit status
Build failed (1 error)
I've been told I have to link my target executable against a dynamic
library libcurl.dylib to progress past this error. I'm running Xcode
2.2 and can't figure out the syntax nor where to place the path to
the link.
Dean Shavit
email@hidden
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden