[Python-Dev] Building Extensions for Python 3.5 on Windows

Paul Moore p.f.moore at gmail.com
Wed Sep 2 17:03:07 CEST 2015


On 2 September 2015 at 14:07, Steve Dower <steve.dower at python.org> wrote:
> You can also build existing object or static libraries into their own DLL
> with the old compiler and dynamically link to them. It's not perfect, but
> it's no worse than trying to link them in directly.

Interesting approach. "gcc -shared -o xpm.dll xpm.a" does about what I
want. Some thoughts:

1. This dynamically links to msvcrt.dll. Is that OK? I guess the
answer is "it's no worse than using such a DLL with Python 3.4 would
be" :-)
2. I presumably need an import lib. I can get gcc to generate a .a
format one, I'll need to see if VC 2015 can handle those, or if
there's a way to convert them (I'm sure there is, but it's been a long
time since I had to do that...)

Anyway, thanks for the response.

Just one further question if I may - on going the other way. Is it
acceptable to embed Python 3.5 (via fully runtime
LoadLibrary/GetProcAddress calls to load python35.dll) in an
application that uses an older CRT? My initial instinct is that it
probably isn't, but I can't think it through - my head's definitely
hurting by now :-)

Paul


More information about the Python-Dev mailing list