[Pythonmac-SIG] Problems with 'multiple definitions'

Tony Lownds tony@adam12.metanet.com
Sun, 20 May 2001 13:12:55 -0700


Hi,

The pre-compiled python on my page has the pyexpat module built-in - 
that may explain why this '_XML_DefaultCurrent' symbol is clashing. 
Maybe it's just me but it seems that the dynamic linking on Mac OS X 
is much stricter about multiple definitions symbols than other UNIXes.

As for compiler flags, man ld shows an "-m" flag:

        -m     Don't treat multiply  defined  symbols  as  a  hard
               error;  instead, simply print a warning.  The first
               such symbol is used for linking; its value is  used
               for the symbol in the symbol table.  The other sym-
               bols by the same name may be used in the  resulting
               output  file  through  local  references.  This can
               still produce a resulting output file  that  is  in
               error.  This flag's use is strongly discouraged!

but I have no idea if that would help.

-Tony

At 10:14 AM +0100 5/20/01, Tony McDonald wrote:
>Hi,
>I'm working with python2.1 and MacOS X and compiling up packages such as
>PyXML and 4Suite (although this happens with packages such as MySQLdb
>too).
>
>I use the standard procedure to build and install these packages, ie
>
>% python2.1 setup.py install
>
>But, for example, when I test out 4Suite;
>
>% cd /usr/local/doc/4Suite-0.11/test_suite/4XSLT
>% python2.1 basic_test.py
>
>I get this;
>
>dyld: python2.1 multiple definitions of symbol _XML_DefaultCurrent
>python2.1 definition of _XML_DefaultCurrent
>/usr/local/lib/python2.1/site-packages/Ft/Lib/cDomlettec.so definition
>of _XML_DefaultCurrent
>
>
>I've managed to install MySQLdb by stripping out an offending symbol
>from libmysqlclient.a, but surely there's a cleaner way of doing this?
>Is there some compiler flag I can set that gets around this?
>
>The python is a pre-compiled version from http://tony.lownds.com/macosx/
>
>any help would be appreciated, this effectively stops me using any
>compiled modules under MacOS X (which is, in almost all other respects,
>excellent!).
>
>I guess this must be a python thing, because I don't get any problems with
>dyld from other unix programs I've compiled up.
>
>TIA
>tone
>--
>Dr Tony McDonald,  Assistant Director, FMCC, http://www.fmcc.org.uk/
>The Medical School, Newcastle University Tel: +44 191 243 6140
>A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope
>
>
>_______________________________________________
>Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
>http://mail.python.org/mailman/listinfo/pythonmac-sig