cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl library problem - symbols not found

From: Patrick MONNERAT <pm_at_datasphere.ch>
Date: Wed, 06 Aug 2008 17:44:28 +0200

On Wed, 2008-08-06 at 10:39 -0400, Patrick Galbraith wrote:

> >
> >> If anyone on this list would, could, be interested in trying these out
> >>
> > and seeing if I"m missing something (particularly with compile, autoconf
> > issues), I could gladly send the source.

I think I've found it:

1) Your configure.ac file uses macro LIBCURL_CHECK_CONFIG from included
file config/ac_curl.m4.This macro defines libcurl cflags in variable
LIBCURL_CPPFLAGS and libs in LIBCURL (see header comment in this file).
2) Still in configure.ac, you define with AC_SUBST variables
CURL_CONFIG, CURL_INC and CURL_LIBS that are never initialized.
3) In src/Makefile.am, you use CURL_INC (uninitialized, thus empty
string) as cflags (in INCLUDES definition) and as additional libraries
(?) in curl_functions_mysql_la_LIBADD definition --> both have NULL
EFFECT !!!

My solution: get rid of CURL_CONFIG, CURL_INC and CURL_LIBS (suppress
AC_SUBSTs), replace their references by the appropriate symbol according
to macro LIBCURL_CHECK_CONFIG. That is (in src/Makefile.am):
INCLUDES = ... $(LIBCURL_CPPFLAGS) ...
and
curl_functions_mysql_la_LIBADD = ... $(LIBCURL)

I did not check if there are other references like that in other files:
I let you do it. But the fix listed above produces a shared library that
has no undefined symbol.

Little trick: if you examine the link command listed at "make" time, you
would have noticed that "-lcurl" was not listed... thus not linked !

Good luck and success for the follow-up.
Patrick
Received on 2008-08-06