cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to build libcurl

From: sumana ts <sumana.tirumala_at_gmail.com>
Date: Thu, 20 Aug 2009 20:00:07 +0530

Hi,
  Even if i try "gcc -L /usr/lib/libcurl.so myapp.c",also throws undefined
symbol reference.
As long as iam using '-lcurl' option,everything works fine(either libcurl
source or the linux installed libcurl).

I feel '-L' is to link to the specified library and -lcurl is the option
which tells the linker to pick the symbols from curl which are
not there in the library path specified with '-L'.So in both the cases
whether i build libcurl on my own or take from the OS,
i have to use -lcurl.Am i correct?

Am i missing anything here?

Thanks,
Sumana

On 8/20/09, sumana ts <sumana.tirumala_at_gmail.com> wrote:
>
> Hi,
> Even with '-L' option pointing to the share object created by the
> libcurl make,is giving us undefined reference of symbols.
> Will the .so created by libcurl make has whole functionality included?You
> could see the errors below.
>
> /tmp/cckcdYeA.o(.text+0x37): In function `main':
> : undefined reference to `curl_global_init'
> /tmp/cckcdYeA.o(.text+0x5a): In function `main':
> : undefined reference to `curl_formadd'
> /tmp/cckcdYeA.o(.text+0x7d): In function `main':
> : undefined reference to `curl_formadd'
> /tmp/cckcdYeA.o(.text+0xa0): In function `main':
> : undefined reference to `curl_formadd'
> /tmp/cckcdYeA.o(.text+0xa8): In function `main':
> : undefined reference to `curl_easy_init'
> /tmp/cckcdYeA.o(.text+0xbb): In function `main':
> : undefined reference to `curl_slist_append'
> /tmp/cckcdYeA.o(.text+0xe0): In function `main':
> : undefined reference to `curl_easy_setopt'
> /tmp/cckcdYeA.o(.text+0x118): In function `main':
> : undefined reference to `curl_easy_setopt'
> /tmp/cckcdYeA.o(.text+0x12e): In function `main':
> : undefined reference to `curl_easy_setopt'
> /tmp/cckcdYeA.o(.text+0x13c): In function `main':
> : undefined reference to `curl_easy_perform'
> /tmp/cckcdYeA.o(.text+0x14d): In function `main':
> : undefined reference to `curl_easy_cleanup'
> /tmp/cckcdYeA.o(.text+0x15b): In function `main':
> : undefined reference to `curl_formfree'
> /tmp/cckcdYeA.o(.text+0x169): In function `main':
> : undefined reference to `curl_slist_free_all'
> collect2: ld returned 1 exit status
>
>
> Thanks,
> Sumana
>
>
> On 8/20/09, Daniel Stenberg <daniel_at_haxx.se> wrote:
>>
>> On Thu, 20 Aug 2009, Krishna Chaithanya Muthyala wrote:
>>
>> If -lcurl is given, I think gcc will take it from the installed libcurl in
>>> the system.
>>>
>>
>> Yes. But then there's -L that allows you to point out another dir to get
>> the lib from.
>>
>> --
>>
>> / daniel.haxx.se
>>
>
>
Received on 2009-08-20