Extending Python with Free Borland Compiler?

dirck at pacbell.net dirck at pacbell.net
Wed Mar 29 03:13:35 EST 2000


In article <01bf98ef$c0063060$e455c3d1 at Cyberus>,
"Gordon Williams" <g_will at cyberus.ca> wrote:
> Hi,
>
> I would like to know if it is possible to extend python with c or c++
using
> the free Borland compiler. I now have it up and running under VIDE and
> would like to use it to write extensions if possible.
>
> Anyone tried it. Anything I should know?
Borland uses a different .lib format than microsoft, and
borland by default adds underscores to all 'cdecl' symbols.
The compiler has an option to turn them off, but then the runtime
libraries have to be rebuilt or nothing will link.
There are other ways to deal with the underscores:
IMPLIB is the borland tool to make a borland .lib from a .dll so you
can statically link to it. The new implib has a '-a' option to add
the underscores that borland expects, so stuff matches when linking
to a non-borland dll.
When linking your dll, a .def file is required to change the names
published by the dll, to do the opposite and get rid of the underscores.
The EXPORTS section allows you to set AliasName=InternalName for
each published entry point.
This didn't work correctly in borland 5.0 - hopefully it's been
fixed in 5.5
In other words, I haven't tried it, but that's what to look out for.
d
dirck at danbala.com
http://www.danbala.com
http://starship.python.net/crew/dirck


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list