From pykde Sat May 28 15:56:18 2005 From: Phil Thompson Date: Sat, 28 May 2005 15:56:18 +0000 To: pykde Subject: Re: [PyKDE] Help on wrapping a C library Message-Id: <200505281656.18045.phil () riverbankcomputing ! co ! uk> X-MARC-Message: https://marc.info/?l=pykde&m=111729581422481 On Tuesday 24 May 2005 7:47 pm, Huaicai Mo wrote: > Hi Phil, > > I am sending you the files: word.h, word.c, word.sip, configure.py, > mytest.c and clib_makefile(the make file used to create the C library and > the test program). After creating the C library, I added the line > /usr/local/lib > to the /etc/ld.so.conf file, and run: > install word*.so /usr/local/lib > ldconfig > > I don't have a python script to test the extension module. I tested > interactively. Here is the snapshot: > > Python 2.3.4 (#2, Aug 19 2004, 15:49:40) [GCC 3.4.1 (Mandrakelinux (Alpha > 3.4.1-3mdk)] on linux2 Type "help", "copyright", "credits" or "license" for > more information. > > >>> import word > >>> print word.anotherReverse("sadkfj;sadf") > > fdas;jfkdas > > >>> print word.__dict__ > > {'create_word': , 'Word': 'word.Word'>, 'reverse': , '__file__': > 'word.so', 'anotherReverse': , > '__name__': 'word', '__doc__': None} > > >>> w = word.create_word("How are you?") > >>>print w > > > > >>> print word.reverse(w) > > Segmentation fault The fix will be in tonight's SIP snapshot. Thanks, Phil _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde