
[Lyle Johnson]
Here's a patch for distutils/msvccompiler.py to ensure that the appropriate Python import library (e.g. "python15.lib" or "python15_d.lib") is linked in with your extension DLL on Windows.
msvccompiler.py is not the right sort of place for patches like this; I'm trying to keep the *CCompiler classes from being specific to building Python extensions. Or rather, from getting any more specific to building Python extensions than they already are (he says, having just poked through unixccompiler.py to see what it imports from sysconfig). But the point is moot: [Thomas Heller]
I never had any problems with this: the Python header files ensure this by a pragma. You (or distutils) don't have to care about this.
It has just occurred to me that those pragmas are awfully handy things, but can we rely on them? What if someone wants to build Python extensions with the Windows port of gcc, or with Borland's newly free-as-in-free-beer compiler? (I imagine they'll have a big job, as they'll probably have to start with building Python itself with said compiler. But this might be yet another little problem along that road.) IOW, perhaps build_ext.py should have yet another bit of Windows-specific code -- not MSVC-specific this time, but Windows-specific -- to (maybe) add the Python DLL to the link. Thoughts? Greg -- Greg Ward - geek gward@python.net http://starship.python.net/~gward/ Disclaimer: All rights reserved. Void where prohibited. Limit 1 per customer.