cURL / Mailing Lists / curl-library / Single Mail

curl-library

problems with static lib

From: John Proctor <jproctor_at_prium.net>
Date: Mon, 3 Jun 2002 16:00:31 -0400

I am having problems linking the static version of libcurl under linux.

I configured and installed the following without error

./configure --prefix=/usr
make
make install

libcurl.a does exist in /usr/lib.

I downloaded ftpget.c from the website example and tried to compile via

gcc -static `curl-config --cflags` `curl-config --libs` -o ftpget ftpget.c

which results in

/tmp/ccGDzJJ9.o: In function `main':
/tmp/ccGDzJJ9.o(.text+0x92): undefined reference to `curl_global_init'
/tmp/ccGDzJJ9.o(.text+0x9a): undefined reference to `curl_easy_init'
/tmp/ccGDzJJ9.o(.text+0xbf): undefined reference to `curl_easy_setopt'
/tmp/ccGDzJJ9.o(.text+0xd8): undefined reference to `curl_easy_setopt'
/tmp/ccGDzJJ9.o(.text+0xf0): undefined reference to `curl_easy_setopt'
/tmp/ccGDzJJ9.o(.text+0x103): undefined reference to `curl_easy_setopt'
/tmp/ccGDzJJ9.o(.text+0x112): undefined reference to `curl_easy_perform'
/tmp/ccGDzJJ9.o(.text+0x126): undefined reference to `curl_easy_cleanup'
/tmp/ccGDzJJ9.o(.text+0x163): undefined reference to `curl_global_cleanup'
collect2: ld returned 1 exit status

If I do not use the -static switch it compiles fine and ftpget works.
I tried with a makefile also, linking libssl, libcurl, libdl and libcrypto.
Same error as above.

Any ideas?

Thanks,
John Proctor

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Received on 2002-06-03