Fwd: Re: [PyKDE] Mapping C++ exceptions to Python exceptions

2002-02-08 Thread Jon



--  Forwarded Message  --

Subject: Re: [PyKDE] Mapping C++ exceptions to Python exceptions
Date: Fri, 8 Feb 2002 05:28:24 -0500 (EST)
From: Donovan Rebbechi <[EMAIL PROTECTED]>
To: Jon <[EMAIL PROTECTED]>

Could you CC this to the list ? It rejects my posts, and the admins of
the list server do not seem interested in fixing the problem.

There currently  isn't a way to do this. You need to use %MemberCode, use
a try/catch  block, and then use PyErr_SetString() or something to set up
a python  exception.

This would be a *very* useful feature. At present, anything that can throw
needs %MemberCode, because if an exception "escapes" a C++ call, the
interpreter aborts. At the very least, it might be worth having an option
for each function that puts the body code in a try {  } block to suppress
exceptions.

--
Donovan

---

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] QSqlCursor problems

2002-02-08 Thread Jon

On Tuesday 05 February 2002 9:02 am, Phil Thompson wrote:
> Jon wrote:
> > Hello
> >
> > I am getting the same problem as reported by Nico van der Walt on Tue, 18
> > Dec 2001.
> >
> > QSqlCursor returns blank for text fields and zero for numeric fields. I
> > am using the MySql driver.
> >
> > Does anyone know if this problem has been resolved yet ?
> >
> > Jon
>
> I've not tested it recently (since I downgraded my g++), but I assume
> the problem is still there. I got as far as finding that the problem was
> from a QVariant ctor being used to copy the column value - but there I
> got stuck. What compiler are you using?
>
> Phil
>
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde

In fact I had fixed the bug. I just had not rebuilt PyQt properly.

So to recap:

QSqlCursor calls QSqlQuery::afterSeek() instead of  QSqlCursor::afterSeek() 
giving a cursor full of zeros. This is fixed by uncommenting void 
afterSeek(); in qsqlcursor.sip and doing a complete rebuild.

Another small problem I found is that 'make rebuild-src' is broken in 
PyQt-3.0.

Jon.

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] QSqlCursor problems

2002-02-07 Thread Jon

On Tuesday 05 February 2002 9:02 am, Phil Thompson wrote:
> Jon wrote:
> > Hello
> >
> > I am getting the same problem as reported by Nico van der Walt on Tue, 18
> > Dec 2001.
> >
> > QSqlCursor returns blank for text fields and zero for numeric fields. I
> > am using the MySql driver.
> >
> > Does anyone know if this problem has been resolved yet ?
> >
> > Jon
>
> I've not tested it recently (since I downgraded my g++), but I assume
> the problem is still there. I got as far as finding that the problem was
> from a QVariant ctor being used to copy the column value - but there I
> got stuck. What compiler are you using?
>
> Phil

I had a go at debugging this and think I've found the problem.

cur = QSqlCursor( "places_table" )
cur.select( "name='burridge'" )
while cur.next():
print cur.value("id").toString()

The call to cur.next() calls afterSeek() but it calls the base class 
QSqlQuery::afterSeek() which is empty instead of QSqlCursor::afterSeek() 
which calls sync() to get the data for the cursor. No call to sync() = all 
zeros in the cursor.

I checked this by running the same code in C++ and sync() is called correctly.

I looked at the sip file for QSqlCursor and afterSeek() is commented out ? I 
tried uncommenting but the problem remains.

I'm stuck now because I don't know what to do to the sip files to get things 
working. 

Can Phil tell me what to do next please.

Jon.

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



Re: [PyKDE] QSqlCursor problems

2002-02-05 Thread Jon

On Tuesday 05 February 2002 9:02 am, Phil Thompson wrote:
> Jon wrote:
> > Hello
> >
> > I am getting the same problem as reported by Nico van der Walt on Tue, 18
> > Dec 2001.
> >
> > QSqlCursor returns blank for text fields and zero for numeric fields. I
> > am using the MySql driver.
> >
> > Does anyone know if this problem has been resolved yet ?
> >
> > Jon
>
> I've not tested it recently (since I downgraded my g++), but I assume
> the problem is still there. I got as far as finding that the problem was
> from a QVariant ctor being used to copy the column value - but there I
> got stuck. What compiler are you using?
>
> Phil
>
> ___
> PyKDE mailing list[EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde

g++ 2.96

Mandrake 8.1
Linux 2.4.9
KDE 2.2.1
Qt 3.0.1
PyQt-3.0
sip-3.0
Python 2.2

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Mapping C++ exceptions to Python exceptions

2002-02-05 Thread Jon

Hello

Can anyone tell me if there is a way of getting SIP to map C++ exceptions to 
Python exceptions ?

Jon


___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Mapping C++ exceptions to Python exceptions

2002-02-04 Thread Jon

Hello

Can anyone tell me if there is a way of getting SIP to map C++ exceptions to 
Python exceptions ?

Jon

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] QSqlCursor problems

2002-02-04 Thread Jon

Hello

I am getting the same problem as reported by Nico van der Walt on Tue, 18 Dec 
2001. 

QSqlCursor returns blank for text fields and zero for numeric fields. I am 
using the MySql driver.

Does anyone know if this problem has been resolved yet ?

Jon


___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Error generated when wrapping a class derived from QCanvasView

2002-01-26 Thread Jon

Hello

If I create a small test c++ class for SIP wrapping, derived from 
QCanvasView. I get the following error when importing the extension module 
into Python. 

undefined symbol: sipCast_QCanvasView__FPCvP7_object

If I change the class so that its derived from QScrollView the error goes 
away.

I have done nm libqtcanvascmodule-3.0.so and both the QCanvasView and 
QScrollView symbols are listed.

Does anybody have an idea what could be wrong ?

Mandrake 8.1
Linux 2.4.9
KDE 2.2.1
Qt 3.0.1
PyQt-3.0
sip-3.0
Python 2.2

Jon

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Problem returning a QString

2002-01-13 Thread Jon

Hello

I am having a problem with the code shown below. I wrap the JJTest C++ class 
with no SIP build errors. In Python I call str1() still no errors. But when I 
try and print with str() I get the error shown.  The Python documentation 
says this error occurs because there are unicode chars in the sting returned 
by str1() - but there isnt and if I change str() to unicode() I get the same 
error.

I compared my str1() function with PyQt's QButton.caption() function and the 
C++ and SIP file layout is exactly the same. If I replace str1() with 
QButton.caption() the error goes away - I dont see what Im doing wrong.

PyQt-3.0
sip-3.0
Python 2.1.1

Jon

//
// JJTest .h

class JJTest : public QObject
{ Q_OBJECT
public:
JJTest(QObject *parent=0, const char *name=0);
QString str1() const;
char * str2() const;
private:
QString theStr;
};

JJTest::JJTest(QObject *parent, const char *name) :
QObject(parent, name),
theStr("theString")
{
}

inline QString JJTest::str1() const
{
return theStr;
}

inline char * JJTest::str2() const
{
  static char * p = "buf";
  return p;
}

//
// JJTest.sip

class JJTest : QObject
{
public:
JJTest(QObject * /TransferThis/ =0, const char * =0);
QString str1() const;
char * str2() const;
};

//
// testArcDocView.py.py

if __name__ == "__main__":
a = QApplication(sys.argv)

mw = QMainWindow()
mw.setCaption("Test");

t = JJTest(None, "JJTest")
aaa = t.str1()
print str(aaa)  # ERROR HERE

b = QButton(mw)
b.setCaption("The Caption")
bbb = b.caption()
print str(bbb)  # NO ERROR HERE

mw.setCentralWidget(b)
mw.show()
a.connect(a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()'))
a.exec_loop()
//
// ERROR

Loading required GL library /usr/X11R6/lib/libGL.so.1.2
Traceback (most recent call last):
  File "/home/john/src/Komodo-1.2.6-33282/Komodo/callkomodo/kdb.py", line 
397, in _do_start
self.kdb.run(code_ob, locals, locals)
  File "/usr/lib/python2.1/bdb.py", line 351, in run
exec cmd in globals, locals
  File "/home/john/projectspy/arcview/testArcDocView.py", line 31, in ?
print str(aaa)
UnicodeError: ASCII encoding error: ordinal not in range(128)
Process terminated with exit code 0


___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Problem returning a QString

2002-01-12 Thread Jon

Hello

I am having a problem with the code shown below. I wrap the JJTest C++ class 
with no SIP build errors. In Python I call str1() still no errors. But when I 
try and print with str() I get the error shown.  The Python documentation 
says this error occurs because there are unicode chars in the sting returned 
by str1() - but there isnt and if I change str() to unicode() I get the same 
error.

I compared my str1() function with PyQt's QButton.caption() function and the 
C++ and SIP file layout is exactly the same. If I replace str1() with 
QButton.caption() the error goes away - I dont see what Im doing wrong.

PyQt-3.0
sip-3.0
Python 2.1.1

Jon

//
// JJTest .h

class JJTest : public QObject
{ Q_OBJECT
public:
    JJTest(QObject *parent=0, const char *name=0);
    QString str1() const;
    char * str2() const;
private:
    QString theStr;
};

JJTest::JJTest(QObject *parent, const char *name) :
QObject(parent, name),
theStr("theString")
{
}

inline QString JJTest::str1() const
{
    return theStr;
}

inline char * JJTest::str2() const
{
  static char * p = "buf";
  return p;
}

//
// JJTest.sip

class JJTest : QObject
{
public:
    JJTest(QObject * /TransferThis/ =0, const char * =0);
    QString str1() const;
    char * str2() const;
};

//
// testArcDocView.py.py

if __name__ == "__main__":
a = QApplication(sys.argv)

mw = QMainWindow()
mw.setCaption("Test");

t = JJTest(None, "JJTest")
aaa = t.str1()
print str(aaa)  # ERROR HERE

b = QButton(mw)
b.setCaption("The Caption")
bbb = b.caption()
print str(bbb)  # NO ERROR HERE

mw.setCentralWidget(b)
mw.show()
a.connect(a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()'))
a.exec_loop()
//
// ERROR

Loading required GL library /usr/X11R6/lib/libGL.so.1.2
Traceback (most recent call last):
  File "/home/john/src/Komodo-1.2.6-33282/Komodo/callkomodo/kdb.py", line 
397, in _do_start
    self.kdb.run(code_ob, locals, locals)
  File "/usr/lib/python2.1/bdb.py", line 351, in run
    exec cmd in globals, locals
  File "/home/john/projectspy/arcview/testArcDocView.py", line 31, in ?
    print str(aaa)
UnicodeError: ASCII encoding error: ordinal not in range(128)
Process terminated with exit code 0

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] sip-3.0 complains about not finding qt.sip

2001-12-26 Thread Jon

Hello

I have installed PyQt-3.0 and sip-3.0, both compiled with no errors.

But I get errors using a sip file that built ok on previous versions. SIP 
complains about not finding qt.sip (where my sip file has %Import qt.sip).

There is no qt.sip in the PyQt sip directory. Has something changed in 
version 3 ? and if so, what do I put in place of %Import qt.sip.

Jon

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] distutils for SIP extensions (=Help needed with SIP)

2001-08-22 Thread Jon

Hello Gerard

Ill go back to 2.4. It works for me.

Bye...

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] distutils for SIP extensions (=Help needed with SIP)

2001-08-22 Thread Jon

Hello Gerard

Did the patch according to your instructions without any problems.

Now get this:

[john@localhost PyMMM-0.0.2]$ python setup.py build_ext
running build_ext
generating MMM/MMM.py from sip/MMM.sip, sip/CCC.sip
/usr/bin/sip -I sip -I /usr/share/sip/qt -c MMM -t Qt_2_3_0 sip/MMM.sip
...fixing by means of fixmmm.fix(dir, name)
...fixing the sip include bugs
g++ -g -O2 -Wall -Wstrict-prototypes -fno-exceptions -fPIC -I/usr/lib/qt2/include 
-I/usr/include/sip -I/home/john/src/PyMMM-0.0.2/MMM -c MMM/sip_helper.cpp -o 
sip_helper.o
g++ sip_helper.o -o MMM/sip_helper
"MMM/sip_helper" has made "MMM/sipMMMVersion.h"
/usr/lib/qt2/bin/moc -o MMM/sipMMMProxyMMM.moc MMM/sipMMMProxyMMM.h
"/usr/lib/qt2/bin/moc" has made "MMM/sipMMMProxyMMM.moc"
/usr/lib/qt2/bin/moc MMM/CCC.h -o MMM/moc_CCC.cpp
"/usr/lib/qt2/bin/moc" has made "MMM/moc_CCC.cpp"
building 'libMMMcmodule' extension
skipping MMM/CCC.cpp (build/temp.linux-i686-2.1/CCC.o up-to-date)
g++ -g -O2 -Wall -Wstrict-prototypes -fno-exceptions -fPIC -I/usr/lib/qt2/include 
-I/usr/include/sip -I/home/john/src/PyMMM-0.0.2/MMM -I/usr/include/python2.1 -c 
MMM/moc_CCC.cpp -o build/temp.linux-i686-2.1/moc_CCC.o
g++ -g -O2 -Wall -Wstrict-prototypes -fno-exceptions -fPIC -I/usr/lib/qt2/include 
-I/usr/include/sip -I/home/john/src/PyMMM-0.0.2/MMM -I/usr/include/python2.1 -c 
MMM/MMMcmodule.cpp -o build/temp.linux-i686-2.1/MMMcmodule.o
g++ -g -O2 -Wall -Wstrict-prototypes -fno-exceptions -fPIC -I/usr/lib/qt2/include 
-I/usr/include/sip -I/home/john/src/PyMMM-0.0.2/MMM -I/usr/include/python2.1 -c 
MMM/sipMMMCCC.cpp -o build/temp.linux-i686-2.1/sipMMMCCC.o
g++ -shared build/temp.linux-i686-2.1/CCC.o build/temp.linux-i686-2.1/moc_CCC.o 
build/temp.linux-i686-2.1/MMMcmodule.o build/temp.linux-i686-2.1/sipMMMCCC.o 
-L/usr/lib/qt2/lib -Lbuild/lib.linux-i686-2.1 -L/usr/lib/python2.1/site-packages -lsip 
-lqt -lqtcmodule -o build/lib.linux-i686-2.1/libMMMcmodule.so
copying MMM/MMM.py -> build/lib.linux-i686-2.1
byte-compiling build/lib.linux-i686-2.1/MMM.py to MMM.pyc
[john@localhost PyMMM-0.0.2]$
[john@localhost PyMMM-0.0.2]$
[john@localhost PyMMM-0.0.2]$
[john@localhost PyMMM-0.0.2]$ python examples/xmmm.py
Traceback (most recent call last):
  File "examples/xmmm.py", line 17, in ?
from MMM import *
ImportError: No module named MMM
[john@localhost PyMMM-0.0.2]$

My autoconf project (which builds and works with PyQt2.4 and sip2.4) gives the 
following errors on PyQt2.5 and sip2.5. Thats why I went back to 2.4 ???

<>
cd . && autoheader
make  all-recursive
make[1]: Entering directory `/home/john/projectspy/filecopy'
Making all in sip
make[2]: Entering directory `/home/john/projectspy/filecopy/sip'
sip -I ../sip -I /usr/share/sip/qt -c . ../sip/MMM.sip
touch rebuild-src
c++ -DHAVE_CONFIG_H -I. -I. -I..  -I/usr/include/python2.1 -I/usr/include/sip 
-I/usr/lib/qt2/include  -I/usr/X11R6/include -
fno-rtti  -fno-exceptions -O2 -c sip_helper.cpp
/bin/sh ../libtool --mode=link c++ -fno-exceptions -O2  -o sip_helper  sip_helper.o 
-L/usr/lib/qt2/lib -lqt -lXext -L/usr/X1
1R6/lib  -lSM -lICE -lX11
c++ -fno-exceptions -O2 -o sip_helper sip_helper.o  -L/usr/lib/qt2/lib -lqt -lXext 
-L/usr/X11R6/lib -lSM -lICE -lX11
./sip_helper >sipMMMVersion.h
c++ -E -I/usr/include/python2.1 -I/usr/include/sip -I/usr/lib/qt2/include  
-I/usr/X11R6/include sipMMMProxyMMM.h >moc_sipMMM
ProxyMMM.h
/usr/lib/qt2/bin/moc -o sipMMMProxyMMM.moc moc_sipMMMProxyMMM.h
/bin/sh ../libtool --mode=compile c++ -DHAVE_CONFIG_H -I. -I. -I..  
-I/usr/include/python2.1 -I/usr/include/sip -I/usr/lib/q
t2/include  -I/usr/X11R6/include -fno-rtti  -fno-exceptions -O2 -c MMMcmodule.cpp
c++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/python2.1 -I/usr/include/sip 
-I/usr/lib/qt2/include -I/usr/X11R6/include -fn
o-rtti -fno-exceptions -O2 -Wp,-MD,.deps/MMMcmodule.pp -c MMMcmodule.cpp  -fPIC -DPIC 
-o MMMcmodule.lo
In file included from sipqtQMenuBar.h:21,
 from sipqtQMainWindow.h:11,
 from sipqtQToolBar.h:10,
 from sipqtQToolButton.h:12,
 from sipqtQStyle.h:19,
 from sipqtQWidget.h:22,
 from sipqtQPixmap.h:15,
 from sipqtQVariant.h:13,
 from sipqtQObject.h:12,
 from sipMMMJJEncryption.h:9,
 from MMMcmodule.cpp:7:
sipqtQPopupMenu.h:78: `QTabletEvent' was not declared in this scope
sipqtQPopupMenu.h:78: parse error before `)'
sipqtQPopupMenu.h:79: `QIMEvent' was not declared in this scope
sipqtQPopupMenu.h:79: parse error before `)'
sipqtQPopupMenu.h:80: `QIMEvent' was not declared in this scope
sipqtQPopupMenu.h:80: parse error before `)'
sipqtQPopupMenu.h:81: `QIMEvent' was not declared in this scope
sipqtQPopupMenu.h:81: parse error before `)'
sipqtQPopupMenu.h:82: `QContextMenuEvent' was not declared in this 
etc...

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde

[PyKDE] Help needed with SIP

2001-08-21 Thread Jon

Hello Gerard

I upgraded to PyQt 2.5 and SIP 2.5. Heres what I got.

As you can see python setup.py build_ext gave an error.

[john@localhost PyMMM-0.0.1]$ python setup.py build_ext
running build_ext
generating MMM/MMM.py from sip/MMM.sip, sip/CCC.sip
/usr/bin/sip -I sip -I /usr/share/sip/qt -c MMM -t Qt_2_3_0 sip/MMM.sip
...fixing by means of fixmmm.fix(dir, name)
...fixing the sip include bugs
g++ -g -O2 -Wall -Wstrict-prototypes -fno-exceptions -fPIC -I/usr/lib/qt2/include 
-I/usr/include/sip -I/home/john/src/PyMMM-0.0.1/MMM -I/usr/include/python2.1 -c MMM/s
ip_helper.cpp -o sip_helper.o
g++ sip_helper.o -L/usr/lib/python2.1/site-packages -o MMM/sip_helper
"MMM/sip_helper" has made "MMM/sipMMMVersion.h"
g++ -E -I/usr/include/python2.1 -o MMM/moc_sipMMMProxyMMM.h
g++: No input files
error: command 'g++' failed with exit status 1

Same with --force on the end.

If I run python setup.py build_ext again I get this:

[john@localhost PyMMM-0.0.1]$ python setup.py build_ext
running build_ext
skipping MMM/MMM.py (inputs unchanged)
building 'libMMMcmodule' extension
error: file 'MMM/moc_CCC.cpp' does not exist

till I manually delete stuff to force a full rebuild.

and trying to run the example gives:

[john@localhost PyMMM-0.0.1]$ python examples/xmmm.py
Traceback (most recent call last):
  File "examples/xmmm.py", line 17, in ?
from MMM import *
ImportError: No module named MMM

I checked all the variables in setup.py and they did not need changing.

Am I doing something stupid ?

You said the readme explains the patch. It mentions a patch but does not say what to 
do to apply it. I have not been doing Linux for long so I need dummy instructions for 
this ?

Does running python setup.py build_ext apply the patch ?

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Help needed with SIP

2001-08-21 Thread Jon

Hello Gerard

Must admit I did not bother to go back and prove what I said about -fno-rtti, anyway 
its working.

Yes Il be happy to return the favor, but Im not on sip-2.5 so it will take a little 
time.

I tried PyQt 2.5 and Sip2.5 about a week ago and had problems, but Ill try it again 
(Ive learned alot in that week).

Ill download ftp://old-labs.polycnrs-gre.fr/pub/SAS/Vermeulen/PyMMM-0.0.1.tar.gz now 
and get back to you ASAP.

I have spent tonight trying to integrate the sip stuff into a KDE Studio Gold project 
as this where I do all my c++ programming. Once thats complete I should have a nice 
environment to work in.


___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Help needed with SIP

2001-08-20 Thread Jon

Hello Gerard

Tried your final suggestions, no luck Im afraid.

I wonder if its a Mandrake 8.0 thing. Is there a reason you have stayed at 7.2 ?

Has anyone else had problems with Mandrake 8.0 and SIP ?

Thanks for all your help.

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Help needed with SIP

2001-08-19 Thread Jon

Hello Gerard

Thanks again for all your help.

I carefully went through your email and tried everything you said but no luck.

1. Yes, I generate a new Makefile.am etc. below is the script I use to pick up changes 
in MMM.sip. I used PyQy and qtgl project files as a starting point for 
autoconf/automake/configure stuff.

2. Yes I get "gcc -shared CCC.lo MMMcmodule.lo..."   (you said CCCcmodule.lo ?) output 
shown below.

3. strings CCC.lo did not find __ti3CCC  (NM lists it as U).

4. Dont know about rtti so I tried both ways, -frtti gives the __ti3CCC error.  
-fno-rtti gives (all listings below are with -fno-rtti):

Python 2.1.1 (#5, Aug 19 2001, 13:52:21)
[GCC 2.96 2731 (Linux-Mandrake 8.0 2.96-0.48mdk)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import MMM
Traceback (most recent call last):
  File "", line 1, in ?
  File "MMM.py", line 6, in ?
import libMMMc
ImportError: /usr/lib/python2.1/site-packages/libMMMcmodule.so: undefined symbol: 
metaObject__C3CCC
>>>

5. I Changed back to libtool 1.4

6. I deleted *.la in site-packages and  /usr/lib/libsip*.la

This is driving me mad. I thought if I started with a very simple example, it would be 
easy !


** c++filt output **

[root@localhost filecopy]# c++filt metaObject__C3CCC
CCC::metaObject(void) const

** NM output **

root@localhost sip]# nm -A -C CCC.lo
CCC.lo: U QPushButton::~QPushButton(void)
CCC.lo:0090 T CCC::~CCC(void)
CCC.lo: U QString::shared_null
CCC.lo: U _GLOBAL_OFFSET_TABLE_
CCC.lo: U QPushButton::QPushButton(QString const &, QWidget *, char const *)
CCC.lo: T CCC::CCC(QWidget *, char const *)
CCC.lo: U QString::QString(char const *)
CCC.lo: U __builtin_delete
CCC.lo: U CCC virtual table
CCC.lo: U CCC::QPaintDevice virtual table
CCC.lo: U QStringData::deleteSelf(void)
CCC.lo: t gcc2_compiled.
CCC.lo: U QString::makeSharedNull(void)
CCC.lo:0130 T CCC::onButtonClicked(void)
CCC.lo: U CCC::result(QString const &)
CCC.lo:00f0 T CCC::setNumber(QString const &)
CCC.lo: U QString::sprintf(char const *,...)
CCC.lo: U QString::toFloat(bool *) const
[root@localhost sip]#


** Build script **

# Force full build
echo "<<  remove  >>"
rm -f config.cache
rm -f ./sip/rebuild-src
# Use sip to make Makefile.am
echo "<< SIP Build Makefile.am >>"
cd ./sip
sip -I ../sip -I /usr/share/sip/qt -m Makefile.am MMM.sip
cd ..
echo "<<  aclocal   >>"
aclocal
echo "<<  autoconf  >>"
autoconf
echo "<<  automake  >>"
automake
echo "<< configure >>"
./configure --with-sip-library=/usr/lib --with-sip-include=/usr/include/sip 
--with-sip-install=/usr/share/sip/qt --with-qt-dir=/usr/lib/qt2
echo "<>"
make

** Build output **

<<  remove  >>
<< SIP Build Makefile.am >>
<<  aclocal   >>
<<  autoconf  >>
<<  automake  >>
<< configure >>
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for a BSD compatible install... /usr/bin/install -c
checking for c++... c++
checking whether the C++ compiler (c++  ) works... yes
checking whether the C++ compiler (c++  ) is a cross-compiler... no
checking whether we are using GNU C++... yes
checking whether c++ accepts -g... yes
checking how to run the C++ preprocessor... c++ -E
checking for Cygwin environment... no
checking for mingw32 environment... no
checking how to run the C preprocessor... cc -E
checking host system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependant libraries... pass_all
checking for object suffix... o
checking for executable suffix... no
checking command to parse /usr/bin/nm -B output... ok
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file

[PyKDE] Help needed with SIP

2001-08-19 Thread Jon

Hello 

Thanks for the help Gerard. 

I added:

MMM_SOURCE = \
    CCC.cpp \
    $S \
    MMM.py

as suggested but get the same error:

Traceback (most recent call last):
  File "MMM.py", line 6, in ?
    import libMMMc
ImportError: /usr/lib/python2.1/site-packages/libMMMcmodule.so: undefined symbol: 
__ti3CCC

I changed to libtool 1.4 because someone said it might help. With libtool version 
1.3.5 I get the following error:

Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.1/site-packages/MMM.py", line 6, in ?
import libMMMc
ImportError: /usr/lib/python2.1/site-packages/libMMMcmodule.so: undefined symbol: 
sipName_qt_destroyed

So Im still stuck.

___
PyKDE mailing list[EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde



[PyKDE] Help needed with SIP

2001-08-18 Thread Jon

Hello

I have the same problem that Joerg JKaercher reported 8 Jun 2001, unfortunatly his 
email conversation with Phil did not seem to come to any conclusion. So Im stuck.

I compile my extension (source below) with no error, then get the following error when 
importing:

Traceback (most recent call last):
  File "MMM.py", line 6, in ?
import libMMMc
ImportError: /usr/lib/python2.1/site-packages/libMMMcmodule.so: undefined symbol: 
__ti3CCC
[john@localhost sip]$ python MMM.py
Traceback (most recent call last):
  File "MMM.py", line 6, in ?
import libMMMc
ImportError: /usr/lib/python2.1/site-packages/libMMMcmodule.so: undefined symbol: 
__ti3CCC

My system is:
Dell Inspiron 8000
Mandrake 8.0
KDE 2.1.1
QT 2.3.0
KDEDIR = /usr
QTDIR = /usr/lib/qt2
libtool 1.4

** CCC.h **

#include 
#include 

class CCC : public QPushButton {
Q_OBJECT

public:
CCC(QWidget* parent=0, const char* name=0);
~CCC();

public slots:
void setNumber(const QString&);

private slots:
void onButtonClicked();

private:
float number;

signals:
void result(const QString&);
};

** CCC.cpp **

#include "CCC.h"

CCC::CCC(QWidget* parent, const char* name) : QPushButton("&Cube", parent, name)
{
number = 0.;
//connect(this, SIGNAL(clicked()), SLOT(onButtonClicked()));
}

CCC::~CCC()
{
}

void CCC::setNumber(const QString& n)
{
bool ok;
float newNumber = n.toFloat(&ok);
if (ok)
{
number = newNumber;
}
}

void CCC::onButtonClicked()
{
QString res;
res.sprintf("%f", number*number*number);
emit result(res);
}

** MMM.sip **

// ---
// This is the SIP interface definition for the MMM module.
// Based on qtgl.sip
// ---

%Module MMM

%Import qt.sip

%Include CCC.sip

%VersionCode
#include 
%End

%Makefile Makefile.am .o
# Makefile for building MMM with autoconf/automake/libtool.


MMM_SOURCES = \
$S \
MMM.py

SIP_FILES = \
CCC.sip \
MMM.sip

noinst_PROGRAMS = sip_helper
sip_helper_SOURCES = sip_helper$c
sip_helper_LDADD = $$(SIP_LDLIBDIRS) -lqt -lXext $$(SIP_LDXFLAGS)

# ---
# rebuild-src (dummy file) depends on sipjjProxyjj.h so that sip will be called
# ---
sipMMMProxyMMM.h: rebuild-src

# ---
# sip outputs c++ files from 'SIP interface definition' files
# ---
rebuild-src: $$(SIP_FILES)
sip -I ../sip -I $$(SIP_SIPINSTALLDIR) -c . ../sip/MMM.sip
touch rebuild-src

sipMMMDeclMMM.h: sipMMMVersion.h

sipMMMVersion.h: sip_helper
./sip_helper >sipMMMVersion.h

# ---
# MOC stuff
# sipMMMProxyMMM.moc is included by MMMcmodule.cpp (thats how it gets compiled)
# ---

MMMcmodule.cpp: sipMMMProxyMMM.moc

sipMMMProxyMMM.moc: sipMMMProxyMMM.h sipMMMVersion.h
$$(CXXCPP) $$(SIP_CPPFLAGS) sipMMMProxyMMM.h >moc_sipMMMProxyMMM.h
$$(SIP_MOC) -o sipMMMProxyMMM.moc moc_sipMMMProxyMMM.h

CLEANFILES = \
MMM.pyc sip_helper sipMMMVersion.h sipMMMProxyMMM.moc \
moc_sipMMMProxyMMM.h sip* Makefile* MMM.py MMMcmodule* rebuild-src

AM_CPPFLAGS = $$(SIP_CPPFLAGS)
AM_CXXFLAGS = $$(SIP_CXXFLAGS)

libdir = $$(SIP_PYTHONDLMODULES)

datadir = $$(SIP_PYTHONMODULES)
data_DATA = MMM.py

lib_LTLIBRARIES = lib$mcmodule.la
lib$mcmodule_la_SOURCES = $$(MMM_SOURCES)
lib$mcmodule_la_LDFLAGS = -release 2.5
lib$mcmodule_la_LIBADD = -L/usr/lib/qt2/lib -L$$(DESTDIR)$$(libdir) -lqtcmodule 
$$(SIP_LDLIBDIRS) -lsip -lqt $$(SIP_LDXFLAGS)

install-data-hook:
(cd /tmp; PYTHONPATH=$$(DESTDIR)$$(datadir):$$(DESTDIR)$$(libdir) 
$$(PYTHONINTERP) -O -c "import MMM")
%End

** CCC.sip **

class CCC : QPushButton
{
%HeaderCode
#include "CCC.h"
%End

public:
CCC(QWidget * /TransferThis/ = 0, const char * = 0);

public slots:
void setNumber(const QString&);

signals:
void result(const QString&);
};

** Build output **

creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for a BSD compatible install... /usr/bin/install -c
checking for c++... c++
checking whether the C++ compiler (c++  ) works... yes
checking whether the C++ compiler (c++  ) is a cross-compiler... no
checking whether we are using GNU C++... yes
checking whether c++ accepts -g... ye