[Tutor] delphi, pascal and Python

andy cheesman at titan.physx.u-szeged.hu
Thu Jun 11 10:42:44 CEST 2009


Hi People 

The error in this code was that the free pascal compiler command listed
below included a framework command suitable only for mac compilations

fpc -MDelphi -Cirot -O1 -gl -XX -k-framework -kpython -WG -vewnhi -l
-Fu. -oPyMinMod.so PyMinMod.dpr

The removal of this framework command cause the compliation to work beautifully

However, the imported module generates a new error

ImportError: PyMinMod.so: undefined symbol: Py_InitModule4

This error seems to crop up regularly within other python programs and
I've not found an obvious solution ... Does anyone know what causes this
type of error? (I'm on 64bit ubuntu btw)

Thanks for any suggestions/help
Andy 

> 
> By the way, the error was generated by following the tutorial and
> compiling in lazarus
> 
> 
> > After Much Looking and pointers from the author, There is this most
> > excellent post by the same author at
> >
> > http://wiki.lazarus.freepascal.org/Developing_Python_Modules_with_Pascal
> >
> > This nearly works but I have issue with the linking of the new module. The
> > error is
> >
> > Linking PyMinMod.so
> > /usr/bin/ld: Python: No such file: No such file or directory
> >
> > I've no clue what the issue is and I don't understand what should be going
> > on. I'm running 64bit ubuntu. I know this might be a bit off topic, but if
> > someone could point me in the right direction, I would be rather grateful
> >
> > Thanks
> > Andy
> >
> >
> >
> >>
> >> "Marc Tompkins" <marc.tompkins at gmail.com> wrote
> >>
> >>>>  Is there a Method for wrapping delphi and/or pascal code into python
> >>>> like
> >>>>> SWIG?
> >>>> http://membres.lycos.fr/marat/delphi/python.htm
> >>>
> >>> That's a package to let you embed Python in Delphi; the OP wants to go
> >>> the
> >>> other direction.
> >>
> >> So it is, I didn't read the OP question closely enough.
> >>
> >> On Windows you could create a DLL and use ctypes to access it,
> >> but thats not the same as creating an importable module as could
> >> be done with SWIG
> >>
> >> Alan G.
> >>
> >>
> >> _______________________________________________
> >> Tutor maillist  -  Tutor at python.org
> >> http://mail.python.org/mailman/listinfo/tutor
> >>
> >
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list