Python DLL in Windows Folder

Ross Ridge rridge at caffeine.csclub.uwaterloo.ca
Sun Dec 23 18:35:57 EST 2007


Markus Gritsch <m.gritsch at gmail.com> wrote:
>... We are embedding Python into our application which
>gets compiled using MSVC 8.0.  We like to link dynamically, so the
>Python interpreter is not statically linked into the program.  The
>Python DLL from the Python installer in the Windows system32 folder is
>compiled using MSVC 7.1.

If you're targetting Windows XP or newer you can use manifests to force
Windows to link your application with a particular version of the DLL.
On Windows 98SE or newer you can use .local files to force Windows to
link with whatever DLLs are in the same directory as your executable.

>Our current solution to the problem is modifying the Python build
>process to produce our Python DLL with a filename containing also the
>patchlevel of the version number i.e. python251.dll instead of
>python25.dll.  This way we can be sure that *our* Python DLL gets
>loaded.  This works fine.

I'd give it a more unique name, like "companyname_python25_1_msvc80.dll".
That gives you more certainty that it is actually your DLL.  You also
won't have to worry if your users copied python251.dll to the system
directory when you upgrade to Visual Studio 2008.

					Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge at csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/~rridge/ 
 db  //	  



More information about the Python-list mailing list