[C++-sig] Delayed load of pythonXX.dll

Niall Douglas s_sourceforge at nedprod.com
Thu Mar 2 15:28:30 CET 2006


On 1 Mar 2006 at 12:37, G Hansford wrote:

> I'm trying to determine if it's possible to delay the loading of the Python
> DLL on Windows. I would like my application to disable scripting support
> (but still run) if Python24.dll is missing. The Delay Loaded DLLs option in
> Visual C++ 7.1 seemed like it would solve my problem, but when I added
> python24.dll, I get the following link error:
> fatal error LNK1194: cannot delay-load 'python24.dll' due to import of data
> symbol '__imp___Py_NoneStruct'
> 
> 
> Having searched a bit on the topic, I found specific discussion of this
> problem in the context of using SWIG, but I can't find anything on it with
> respect to boost.python. I am statically linking the boost_python.lib and
> everything works properly when I don't try to force the delay load. Does
> anyone have any insight on this?

Think about it - if your program uses a variable stored in 
python24.dll, then your delay loaded DLL would just be immediately 
loaded on program run. And that's pointless.

Cheers,
Niall






More information about the Cplusplus-sig mailing list