[PyKDE] provide custom widget to python

Jan Drugowitsch jdrugo at gmx.at
Tue Dec 16 13:28:01 GMT 2003


On Monday 15 December 2003 22:13, Phil Thompson wrote:
> On Monday 15 December 2003 10:03 pm, Jan Drugowitsch wrote:
> > On Monday 15 December 2003 17:02, Jim Bublitz wrote:
> > > On Monday December 15 2003 08:13, Jan Drugowitsch wrote:
[long snip]
> >
> > Thanks, both of you, %Import was what I was searching for. After some
> > minor modifications I was able to get sip run error-free. Compilation and
> > linking also worked, but it seems I am missing a library somewhere. The
> > commands I am using:
> >
> > sip -I /usr/share/sip/qt -t Qt_3_2_0 -t WS_X11 -c td_sip tokendisplay.sip
> > g++ -c -Wall -o libTokenDisplayc.o -I /usr/include/python2.2 -I
> > /usr/qt/3/ include -I td_sip -I . td_sip/TokenDisplaycmodule.cpp
> > g++ -shared -o libTokenDisplayc.so -L /usr/lib/python2.2/site-packages -l
> > qtcmodule -L /usr/qt/3/lib -l qt-mt libTokenDisplayc.o
> >
> > When i try to import the module in python i get the following:
> > >>> import TokenDisplay
> >
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File "TokenDisplay.py", line 8, in ?
> >     import libTokenDisplayc
> > ImportError: ./libTokenDisplayc.so: undefined symbol:
> > _ZTV20sipProxyTokenDisplay
> >
> > nm libTokenDisplayc.so | grep sipProxyTokenDisplay gives
> > 000014b4 T _ZN20sipProxyTokenDisplay12getProxySlotEPc
> > 000014d6 T
> > _ZN20sipProxyTokenDisplay9proxySlotEN12TokenDisplay11MouseButtonEj
> > 000015ea T _ZN20sipProxyTokenDisplay9proxySlotEP7QObject
> > 00001560 T _ZN20sipProxyTokenDisplay9proxySlotEii
> > 00001684 T _ZN20sipProxyTokenDisplay9proxySlotEv
> > 000018e2 W _ZN20sipProxyTokenDisplayC1Ev
> >          U _ZTV20sipProxyTokenDisplay
> > 00002d7c d _ZZN20sipProxyTokenDisplay12getProxySlotEPcE3tab
> >
> > Neither libqtcmodule.so nor libsip.so contain this symbol either.
> > Any clue what's wrong here?
>
> There will be a .h file that was generated (sorry, can't remember the name
> at the moment as it varies between some SIP versions) that you need to run
> moc on and compile and link the C++ code it generates.

Ok, after moc'ing sipTokenDisplayProxyTokenDisplay.h, compiling everything and 
linking half of the world together (which gave me a 255Kb library - maybe a 
bit too much for one widget) it finally works! Or at least it imports without 
complaining about undefined symbols. Haven't tried in in a QApp yet,

still, thanks everyone!
Jan




More information about the PyQt mailing list