installing extention modules

Mike Johnson ffp_randjohnson at yahoo.com
Sat Aug 4 12:21:21 EDT 2001


Hello,

I've built an embryonic python extension library for AbiWord, and I'm
wondering how I go about installing this library I've created.

When I try to import the module I built, I get:

>>> import Abi
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: dynamic module does not define init function (initAbi)

I've scoured the online documentation, and I've read anything google came
up with relating to extending python... but there isn't a lot to describe
actually installing this module.

(If you can't tell, I'm as yet unfamiliar with the Unix concept of
linking, so don't assume I know anything :-)

I've compiled with the options (in the AW source tree):

g++ -fPIC -g -c -I../../af/ev/xp -I../../af/xap/xp -I../../af/util/xp
-I../../af/util/unix -I../../../../expat/lib -I../../text/fmt/xp
-I../../text/ptbl/xp -I../../af/gr/xp -I../../wp/impexp/xp
-I../../wp/ap/xp -fno-strict-aliasing -O2 -march=i386 -mcpu=i686 -fPIC
-L/usr/lib/python2.1/config/libpython2.1.a -I/usr/include/python2.1 
AbiPython.cpp

And then:
g++ -shared -Wl,-soname,Abi.so -o Abi.so -lc

And after this I drop the created file into the /usr/lib/python directory.

But I'm guessing that this compilation is three shades of wrong, too. I'm
finally not getting the "unresolved symbols" errors anymore, at least!

My questions come down to:

1) Do I need to use libtool? I noticed that pygnome uses it, and I've
studied how it's built, but I don't yet understand enough about it's build
process.

2) Do python modules need any special compile parameters?

3) Is there a place I can learn more about Unix linking? Google's not
helping much in that department, or maybe the documentation is just a bit
sparse.

Thank you all for a great language, and for any help you might be able to
provide. I'd really like to work with AbiWord in my favorite language. :-)

- Mike Johnson


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----



More information about the Python-list mailing list