[Python-Dev] Static builds on Windows (continued)

Marvin marvinpublic at comcast.net
Thu Oct 6 23:22:09 CEST 2005


> Date: Wed, 05 Oct 2005 00:21:20 +0200
> From: "Martin v. L?wis" <martin at v.loewis.de>
> Subject: Re: [Python-Dev] Static builds on Windows (continued)
> Cc: python-dev at python.org
> Message-ID: <43430060.6070909 at v.loewis.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Marvin wrote:
> 
>>I built pythoncore and python. The resulting python.exe worked fine, but did
>>indeed fail when I tried to dynamically load anything (Dialog said: the
>>application terminated abnormally)
> 
> 
> Not sure what you are trying to do here. In your case, dynamic loading 
> simply cannot work. The extension modules all link with python24.dll, 
> which you don't have. It may find some python24.dll, which then gives 
> conflicts with the Python interpreter that is already running.
> 
> So what you really should do is disable dynamic loading entirely. To do
> so, remove dynload_win from your project, and #undef 
> HAVE_DYNAMIC_LOADING in PC/pyconfig.h.
> 
> Not sure if anybody has recently tested whether this configuration
> actually works - if you find that it doesn't, please post your patches
> to sf.net/projects/python.
> 
> If you really want to provide dynamic loading of some kind, you should
> arrange the extension modules to import the symbols from your .exe.
> Linking the exe should generate an import library, and you should link
> the extensions against that.
> 
> HTH,
> Martin
> 

I'll try that when I get back to this and feed back my results.  I figured out 
that I can avoid the need for dynamic loading.  I wanted to use some existing 
extension modules, but the whole point was to use the existing ones which as you 
point out are linked against a dll.  So even if I created an .EXE that exported 
the symbols, I'd still have to rebuild the extensions.


More information about the Python-Dev mailing list