Compiling Python under Borland C++ Builder 4
Greg Couch %CGL
gregc at cgl.ucsf.edu
Tue Jan 18 22:42:21 EST 2000
Nice to know that there are other people using C++ Builder 4 with Python.
We've been successful just using BCB for .pyd's and .dll's. That way we
can use the standard Windows Python distribution.
There are a couple of tricks:
1. When making a BCB python15.lib from python15.dll, implib doesn't
put leading underscores on symbols that already have an underscore.
The workaround is to use impdef, fix up each line to rename symbols,
and use implib on that.
2. BCB puts leading underscores on all symbols, so Python fails to
import the pyd/dll correctly (Python expects initMODULE and BCB
generates _initMODULE). The solution is to add a MODULE.def with
the following:
EXPORTS
initMODULE = _initMODULE
and link it in when building the pyd/dll.
Hope this helps,
Greg Couch
UCSF Computer Graphics Laboratory
gregc at cgl.ucsf.edu
More information about the Python-list
mailing list