cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: how to get the libcurl up and running in my C code.

From: goeie spullen <goeiespullen_at_gmail.com>
Date: Thu, 3 Feb 2011 21:34:53 +0100

Thanx Kamil, I don't understand the linking stuff but it *does* work:

itops_at_itops-laptop:~/development/preventel/code/ftpclient$ cc -lcurl
ftptest4.c
itops_at_itops-laptop:~/development/preventel/code/ftpclient$ cc -lcurl
ftptest4.c -o ftptest
itops_at_itops-laptop:~/development/preventel/code/ftpclient$ ls -lrt
-rw-r--r-- 1 itops itops 3740 2011-02-03 20:46 ftptest4.c
-rwxr-xr-x 1 itops itops 9157 2011-02-03 21:28 ftptest
itops_at_itops-laptop:~/development/preventel/code/ftpclient$ ./ftptest
Couldnt open '/tmp/uploadthis.txt': No such file or directory

:)
This save my night.

You helped me great with the part I didn't get. Now that I am a step
further, lets focus on generating functionality.

Cheers,
Maarten

2011/2/3 Kamil Dudka <kdudka_at_redhat.com>

> On Thursday 03 February 2011 20:52:04 goeie spullen wrote:
> > Hi Alan, thanx for you quick reply. The issue is that I don't get the
> > complilation up and running:
> >
> > I downloaded the following file and tried to compile it:
> > https://github.com/bagder/curl/raw/master/docs/examples/ftpupload.c
> >
> >
> > itops_at_itops-laptop:~/development/preventel/code/ftpclient$ cc ftptest4.c
> > /tmp/ccvb2cjd.o: In function `main':
> > ftptest4.c:(.text+0x178): undefined reference to `curl_global_init'
>
> This is not about compilation. The error message above comes from the
> linker. You need to link against libcurl. Try to append -lcurl.
>
> Kamil
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-03