cURL / Mailing Lists / curl-users / Single Mail

curl-users

R: curl_easy_init not defined

From: Luigi Grilli <luigi.grilli_at_elmo.it>
Date: Fri, 8 Aug 2008 12:07:28 +0200

You need to check in your system where is the library installed.

In my system is in /usr/lib

Maybe you have it in /usr/local/lib

 

It's seems that ld can't find the library in your system paths.

Try to add the path where you have the libcurl.so.4 to your LD_LIBRARY_PATH variable, like this:

export LD_LIBRARY_PATH=/usr/local/lib

substitute the path with the one where libcurl is installed.

 

This is a temporary (session) solution. You will need to change system configuration as root to make it permanent.

 

 

 

________________________________

Da: curl-users-bounces_at_cool.haxx.se [mailto:curl-users-bounces_at_cool.haxx.se] Per conto di Cristina Gil
Inviato: venerdì 8 agosto 2008 11.57
A: the curl tool
Oggetto: RE: curl_easy_init not defined

 

Thanks for your answers, i did it and it compiled but when i try to execute with ./progam I have this error:

 

Error while loading shared libraries: libcurl.so.4: cannot shared object file: no such file or directory

 

Do I need to install another library??

 

 

 

________________________________

De: curl-users-bounces_at_cool.haxx.se [mailto:curl-users-bounces_at_cool.haxx.se] En nombre de Luigi Grilli
Enviado el: viernes, 08 de agosto de 2008 11:32
Para: the curl tool
Asunto: R: curl_easy_init not defined

 

You need also to link to the library.

If the library is installed in the system you just need to have a -lcurl in your gcc command line like this:

gcc -lcurl -o program program.c

 

You also need to change void to int as main return value.

 

________________________________

Da: curl-users-bounces_at_cool.haxx.se [mailto:curl-users-bounces_at_cool.haxx.se] Per conto di Cristina Gil
Inviato: venerdì 8 agosto 2008 11.24
A: curl-users_at_cool.haxx.se
Oggetto: curl_easy_init not defined

 

Hello!

Im a newbie in C programming, i have to program an application to use it as a daemon which sends periodically a http request to the server.

 

Im write this:

 

#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <curl/curl.h>

 

void main(){

 CURL *curl;

 char *url;

 

url="http://192.168.0.63:80/admin/serverreport.cgi";

 curl = curl_easy_init();

 

 if(curl) {

   curl_easy_setopt(curl,CURLOPT_URL, url);

   curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

   curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");

   curl_easy_cleanup(curl);

 

 };

}

 

But when I try to compile, gcc -o program program.c,

The compiler says that

(.text+0x12) Reference to curl_easy_init not defined

(.text+0x36) Reference to curl_easy_setopt not defined

(.text+0x41) Reference to curl_easy_setopt not defined

(.text+0x64) Reference to curl_easy_setopt not defined

(.text+0x92) Reference to curl_easy_cleanup not defined

 

Thanks for your help!

 

 

 

________________________________

AVISO LEGAL
La Informacion incluida en el presente correo electronico es SECRETO PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del destinatario arriba mencionado. Si usted lee este mensaje y no es el destinatario señalado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicacion por error, le informamos que esta totalmente prohibida cualquier divulgacion, distribucion o reproduccion de esta comunicacion, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la direccion arriba mencionada. Gracias.

 

________________________________

AVISO LEGAL
La Informacion incluida en el presente correo electronico es SECRETO PROFESIONAL Y CONFIDENCIAL, siendo para el uso exclusivo del destinatario arriba mencionado. Si usted lee este mensaje y no es el destinatario señalado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicacion por error, le informamos que esta totalmente prohibida cualquier divulgacion, distribucion o reproduccion de esta comunicacion, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la direccion arriba mencionada. Gracias.

________________________________

 http://www.elmospa.it/AreaFTP/progettisti/logo-firma-email.jpg<http://www.elmospa.it/AreaFTP/progettisti/logo-firma-email.jpg>

 

 

 

El.Mo. S.p.a.
Via Pontarola 70 - Reschigliano
35011 - Campodarsego (PD)
Italy

 

 

 

 

Luigi Grilli

Research & Development
Phone : +39 049 9203333

Fax : +39 049 9203375

Web : http://www.elmo.it

Mail : luigi.grilli_at_elmo.it

________________________________

AVVERTENZE AI SENSI DEL D.LGS. 196/2003
Le informazioni contenute o allegate alla presente email sono rivolte unicamente alle persone cui la email è indirizzata; la riservatezza del messaggio e dei suoi contenuti è tutelata. Sono vietate la riproduzione, la distribuzione, la copia e l'uso di questa email in mancanza di autorizzazione del destinatario. Se avete ricevuto questa email per errore, vogliate cortesemente darne notifica al Mittente tramite fax o mail. Quanto precede è valido ai fini del rispetto del D.Lgs. 196/03 sulla tutela dei dati personali.
NOTICE
The information contained in this email and any attachments is confidential and may be legally privileged. If you are not the intended recipient you are hereby notified that you must not use, disclose, distribute, copy, print or rely on this email's content. If you are not the intended recipient, please notify the sender immediately by email or fax and then delete the email and any attachments from your system.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-08-08