cURL / Mailing Lists / curl-library / Single Mail

curl-library

"common symbols" in libcurl.a?

From: Dan Wood <djw_lists_at_pacbell.net>
Date: Wed, 26 Jun 2002 16:18:56 -0700

I've recently grabbed the 7.9.8 build of Curl, and either in
that, or something else in my build environment (which is Mac OS
X), I'm getting some problems linking libcurl.a into my code.
I'm getting the following error message:

        ld: common symbols not allowed with MH_DYLIB output format

I got some info from an expert on linking on Mac OS X, and he
said: "This has to do with the ... restriction only allowing
one definition of each symbol in shared library modules."

He offers a workaround: "to create a true definition of the
common symbol _curl_jmpenv. This can be done in a couple of
ways. One is to take apart the /usr/local/lib/libcurl.a archive
and use the static linker's -d flag to change the common symbol
into a definition. This is a bit complicated but would be done
with something like:

     % mkdir /tmp/curl
     % cd /tmp/curl
     % ar x /usr/local/lib/libcurl.a
     % ld -r -d hostip.o
     % mv a.out hostip.o
     % libtool -o /usr/local/lib/libcurl.a *.o

Now I suppose I can do this in a build script, but I'm wondering
if there's anything that can be "fixed" in libcurl's upcoming
version so that this workaround isn't needed.

I'm really not very familiar with intracacies of linkers and
makefiles and such. Maybe Daniel or somebody here has some idea
what can be done to simplify things. I really miss the previous
versions, where I'd just link the library in without any trouble
at all.

Thoughts?

Regards,
Dan Wood

--
Dan Wood
Karelia Software, LLC
dwood_at_karelia.com
http://www.karelia.com/
Watson for Mac OS X: http://www.karelia.com/watson/
-------------------------------------------------------
This sf.net email is sponsored by: Jabber Inc.
Don't miss the IM event of the season | Special offer for OSDN members! 
JabberConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn
Received on 2002-06-27