Subject: Re: Cygwin GCC linking Python extensions issue
From: Jason Tishler <[email-masked]>
To: David Abrahams <[email-masked]>
Cc: [email-masked]
Date: Tue, 27 May 2003 16:13:13 -0400

Dave,

On Tue, May 27, 2003 at 10:45:22AM -0400, David Abrahams wrote:
> Jason Tishler <[email-masked]> writes:
> >>     boost_python.dll\gcc\debug-python\runtime-link-dynamic\boost_python.lib"  "c:\build\libs\
> >>     python\build\bin\boost_python.dll\gcc\debug-python\runtime-link-dynamic\boost_python.lib"
> >>     -lpython2.3.dll
> >        ^^^^^^^^^^^^^
> >
> > Does the above imply direct linking against the DLL (i.e.,
> > python2.3.dll) instead of the import library (i.e.,
> > python2.3.dll.a)?  
> 
> No, when you write -lxxx, you link against libxxx.a, so I'm linking
> against the import library: libpython2.3.dll.a

IIRC, the above is not necessary true for Cygwin -- -lfoo can resolve to
more things than under Unix.  Anyway, please use -Wl,--verbose to
determine what "-lpython2.3.dll" is resolving to.

I would try "-lpython2.3" too.

> >> d000000.o(.idata$2+0x0): multiple definition of `__head_boost_python_dll'
> >> c:\build\libs\python\build\bin\boost_python.dll\gcc\debug-python\runtime-link-dynamic\
> >>     boost_python.lib(d000000.o)(.idata$2+0x0): first defined here
> >> d000001.o(.idata$5+0x0): multiple definition of `__imp___ZN5boost6python5scope13current_scopeE'
> >> c:\build\libs\python\build\bin\boost_python.dll\gcc\debug-python\runtime-link-dynamic\
> >> [snip]
> >> Info: resolving boost::python::scope::current_scope     by linking to
> >>     __imp___ZN5boost6python5scope13current_scopeE (auto-import)
> >
> > Try providing the necessary __declspec(dllimport)/__declspec(dllexport)
> > to eliminate the auto-import.
> 
> For one thing, I don't know which ones are "the neccessary" ones:
> __head_boost_python_dll is not my symbol.

I believe fixing the "__imp___ZN5boost6python5scope13current_scopeE"
auto-import symbol will make the __head_boost_python_dll problems go
away.  I have seen similar problems with the Cygwin PostgreSQL build due
to missing __declspec(dllimport)'s albeit with dlltool.

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/