IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label symbols. Show all posts
Showing posts with label symbols. Show all posts

Friday, January 25, 2013

Undefined symbols for architecture x86_64

I'm trying to run following code in mac os x mount lion (64 bit) but the curl library is not designed for same.

Please help how can i run this

 

C++ Application Code

 

#include

#include

#include

#include

size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) {

    size_t written;

    written = fwrite(ptr, size, nmemb, stream);

    return written;

}

 

int main() {

    std::string tempname = "temp";

    CURL *curl;

    CURLcode res;

    curl = curl_easy_init();

    if(curl) {

        FILE *fp = fopen(tempname.c_str(),"wb");

        curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com");

        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);

        curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);

        res = curl_easy_perform(curl);

        curl_easy_cleanup(curl);

        fclose(fp);

        fp = fopen(tempname.c_str(),"rb");

        fseek (fp , 0 , SEEK_END);

        long lSize = ftell (fp);

        rewind(fp);

        char *buffer = new char[lSize+1];

        fread (buffer, 1, lSize, fp);

        buffer[lSize] = 0;

        fclose(fp);

        std::string content(buffer);

        delete [] buffer;

    }

}

 

Error:

 

Undefined symbols for architecture x86_64:

  "_curl_easy_cleanup", referenced from:

      _main in main.o

  "_curl_easy_init", referenced from:

      _main in main.o

  "_curl_easy_perform", referenced from:

      _main in main.o

  "_curl_easy_setopt", referenced from:

      _main in main.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)


View the original article here

C CURL ld: symbol(s) not found

I am trying to write a cli application using libcurl. I am getting this error and I have been unable to find a solution. Would someone please help me out here?

 

wes-imac:RR Ticket Watcher wes_dean$ gcc -o build/Test.app -I/opt/local/include -L/opt/local/lib -lcurl -lidn -lssl -lcrypto -lssl -lcrypto -lz source/*

source/main.c:7: warning: ‘write_callback_func’ used but never defined

Undefined symbols for architecture x86_64:

  "_write_callback_func", referenced from:

      _main in ccBWsrR4.o

ld: symbol(s) not found for architecture x86_64

collect2: ld returned 1 exit status

 

I have tried the -m32 option as well. I get the same error, only for a 32 bit architecture.

 

The tutorial that I am using says to include the curl/types.h header file, but this is the result when I do that.

 

wes-imac:RR Ticket Watcher wes_dean$ gcc -o build/Test.app -I/opt/local/include -L/opt/local/lib -lcurl -lidn -lssl -lcrypto -lssl -lcrypto -lz source/*

source/main.c:6:24: error: curl/types.h: No such file or directory

 

I have installed XCode with the Command Line Tools. I am running OS 10.8.2 and doing all development from the terminal.

 

 

 

 

#include

#include

#include

#include

#include

#include

 

 

size_t static write_callback_func (void *buffer, size_t size, size_t nmemb, void *userp);

 

 

main (argc, argv, envp)

int argc;

char *argv[], *envp[];

{

  CURL *curl;

  CURLcode res;

  char *response;

 

 

  char url[255];

 

 

  if (argc > 1) {

    strcpy(url, argv[1]);

  }

 

 

  curl = curl_easy_init();

  if (curl) {

    curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);

    curl_easy_setopt(curl, CURLOPT_URL, url);

    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback_func);

    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

 

 

    res = curl_easy_perform(curl);

    if (res != CURLE_OK) {

      fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));

    }  

    curl_easy_cleanup(curl);

  }

 

 

  printf("%s", response);

 

 

  printf("\n");

 

 

  return 0;

}


View the original article here

Undefined symbols for architecture x86_64

I'm trying to run following code in mac os x mount lion (64 bit) but the curl library is not designed for same.

Please help how can i run this

 

C++ Application Code

 

#include

#include

#include

#include

size_t write_data(void *ptr, size_t size, size_t nmemb, FILE *stream) {

    size_t written;

    written = fwrite(ptr, size, nmemb, stream);

    return written;

}

 

int main() {

    std::string tempname = "temp";

    CURL *curl;

    CURLcode res;

    curl = curl_easy_init();

    if(curl) {

        FILE *fp = fopen(tempname.c_str(),"wb");

        curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com");

        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);

        curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);

        res = curl_easy_perform(curl);

        curl_easy_cleanup(curl);

        fclose(fp);

        fp = fopen(tempname.c_str(),"rb");

        fseek (fp , 0 , SEEK_END);

        long lSize = ftell (fp);

        rewind(fp);

        char *buffer = new char[lSize+1];

        fread (buffer, 1, lSize, fp);

        buffer[lSize] = 0;

        fclose(fp);

        std::string content(buffer);

        delete [] buffer;

    }

}

 

Error:

 

Undefined symbols for architecture x86_64:

  "_curl_easy_cleanup", referenced from:

      _main in main.o

  "_curl_easy_init", referenced from:

      _main in main.o

  "_curl_easy_perform", referenced from:

      _main in main.o

  "_curl_easy_setopt", referenced from:

      _main in main.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)


View the original article here

Re: C CURL ld: symbol(s) not found

Hey buddy,

I am facing a similar problem .. how do you run this for 64 bit arcitecture please give me the link to the tutorial .. please help .. thanks in advance.


View the original article here