cURL / Mailing Lists / curl-library / Single Mail

curl-library

Symbols not found error in Xcode

From: Kushan Thakkar <kthakk4_at_gmail.com>
Date: Wed, 3 Jun 2009 02:42:01 -0400

Hi

I am writing a c++ command line utility with libcurl using Xcode on a mac.
Following is the code I am using:

#include <iostream>
#include <string>
#include <curl/curl.h>

using namespace std;

int main()
{
    CURL *curl;
    CURLcode result;

    curl = curl_easy_init();
    if (curl)
    {
        curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com");
        result = curl_easy_perform(curl);

        curl_easy_cleanup(curl);

        cout << result;
    }

    return 0;
}

When I run this code, I get the following four errors:

  "_curl_easy_perform", referenced from:
      _main in main.o
  "_curl_easy_setopt", referenced from:
      _main in main.o
  "_curl_easy_cleanup", referenced from:
      _main in main.o
  "_curl_easy_init", referenced from:
      _main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Can someone please help me resolve this problem?

Thanks,
Kushan
Received on 2009-06-03