[PyKDE] Passing C++-created QWidgets to embedded Python

Phil Thompson phil at river-bank.demon.co.uk
Tue Apr 16 17:10:53 BST 2002


ian reinhart geiser wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Tuesday 16 April 2002 10:42 am, Phil Thompson wrote:
> > Robin Summerhill wrote:
> > > I finally worked out what was going wrong here.
> > >
> > > It's to do with the requirement to mark declarations with
> > > __declspec(DLLEXPORT) or _declspec(DLLIMPORT)to get DLL linking working
> > > properly with MSVC.
> > >
> > > SIP_EXTERN is declared in sip.h and ends up as SIP_EXPORT or SIP_IMPORT
> > > according to whether the preprocessor symbols SIP_MAKE_DLL or SIP_USE_DLL
> > > are defined. Sip.exe uses this declaration to enable sip-generated
> > > headers to be used both in building the dll (EXPORT) and the client of
> > > the dll (IMPORT). However, the sip-generated headers that are included in
> > > the PyQT distribution have been edited to change SIP_EXTERN to
> > > SIP_EXPORT, meaning that these headers can only be used to build the
> > > libqtc dll, *not* consume it.
> > >
> > > There is no clean way around this with the present setup, because
> > > SIP_EXTERN is used in the SIP headers too. You can't just change
> > > SIP_EXPORT back to SIP_EXTERN because that prevents you from building
> > > libqtc.
> >
> > Hopefully fixed in 3.2 - but I haven't tested it. You won't need to
> > specify SIP_USE_DLL anymore - things "should just work".
> >
> > If you are creating a module that %Imports the PyQt .sip files then you
> > will now need -DSIP_MAKE_MODULE_DLL in the CXXFLAGS.
> Will this work the same if I am includeing other .sip files from other C
> modules I have built?

I assume you mean import rather than include.

> Also when building a C module that is not based off of PyQt and just SIP will
> I need any special arguments to allow for it to export properly?

-DSIP_MAKE_MODULE_DLL is now needed for any module that you are
building.

Phil





More information about the PyQt mailing list