[Pythonmac-SIG] Problem with module linking

Nicholas Riley njriley@uiuc.edu
Wed, 11 Dec 2002 23:50:35 -0600


On Thu, Dec 12, 2002 at 01:33:29AM +0100, Jack Jansen wrote:
> 
> On woensdag, dec 11, 2002, at 22:55 Europe/Amsterdam, Nicholas Riley 
> wrote:
> >Is there any way to get a more detailed error message?
> 
> Yes, by getting Python 2.3a0, i.e. the CVS version from Python. It 
> prints more information, including the text of the error message from 
> dyld. You could also try to graft the following code (which I lifted 
> from 2.3a0) onto your 2.2.2 version of Python/dynload_next.c:

Thanks, that gives me a very clear error:

>>> import svn._fs
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: Failure linking new module: : dyld: ./python.exe multiple
definitions of symbol _SWIG_ConvertPacked
/Library/Frameworks/Python.framework/Versions/2.2/lib/python2.2/site-packages/svn/_ra.so
definition of _SWIG_ConvertPacked
/Library/Frameworks/Python.framework/Versions/2.2/lib/python2.2/site-packages/svn/_fs.so
definition of _SWIG_ConvertPacked

The comment at the top of 2.3a0's dynload_next.c (amazing how much
cleaner it looks with the support for rld stripped out! :) explains
the problem.  So far, so good, without USE_DYLD_GLOBAL_NAMESPACE
defined, I just replaced 2.2.2's dynload_next.c with 2.3a0's, and
everything worked.

Incidentally, how would you fix the problem so it'd work even with
USE_DYLD_GLOBAL_NAMESPACE defined?  I assume this'll happen with any
two SWIG-generated modules on OS X.

-- 
=Nicholas Riley <njriley@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
        Pablo Research Group, Department of Computer Science and
  Medical Scholars Program, University of Illinois at Urbana-Champaign