At 04:44 PM 10/30/00 +0100, Morten W. Petersen wrote:
>After compiling the DynPerist module, I try to import it in the Python
>interpreter:
>
>"""
>morten@slakka:/usr/local/Zope/lib/python/Products/ZPatterns > gcc -o
DynPersist.so -c DynPersist.c -I../../ZODB
-I../../../Components/ExtensionClass -I/usr/include/python1.5
>morten@slakka:/usr/local/Zope/lib/python/Products/ZPatterns > python
>Python 1.5.2 (#1, Mar 11 2000, 13:03:53)  [GCC 2.95.2 19991024 (release)]
on linux2
>Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>>> import DynPersist
>Traceback (innermost last):
>  File "<stdin>", line 1, in ?
>ImportError: ./DynPersist.so: ELF file's phentsize not the expected size
>>>>
>"""
>
>Any ideas what I'm doing wrong (is it maybe the compiler)?
>

There's a couple things wrong here.  First, you're compiling a .c directly
to an .so, which is wrong.  GCC is obeying your command and making a .o
file with an .so extension, which will not work.  You really should use the
standard python module make process.  Copy Makefile.pre.in from your python
tree into the directory, then run "make -f Makefile.pre.in boot", followed
by "make".  Then you'll end up with a working DynPersist.so.

Second, don't try to load it from python in the ZPatterns directory,
because DynPersist is dependent on the cPersistence and ExtensionClass .so
modules, which Python won't be able to find if you run it in that
directory.  You need to include the directories containing those things on
your PYTHONPATH, if you want to use it.  As a practical matter, however,
DynPersist is pretty useless outside the Zope environment, so I'd say just
build it the correct way and give it a try in Zope.


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to