win32 python as a dll?

Scott Wolford wolford at enews.nrl.navy.mil
Fri Jul 9 10:40:57 EDT 1999


Mark Hammond wrote:

> Scott Wolford wrote in message <37850F5B.F80CB0A7 at enews.nrl.navy.mil>...
>
> >msvcrt.lib and the application can't then bring in msvcrtd.lib. I do think
> >this is a problem because python15_d.lib is provided but no python15_d.dll
> >is. I would think you'd provide (at the very least) python.lib linked with
> >msvcrt.lib, and python_d.lib linked with msvcrtd.lib (and the dlls), or
> >(to be really nice :) all four combinations.
>
> The main reason we dont is size - we would need to ship the _d, and for
> people to really use it, also the .pdb.  These add too many megs.
>
> Further, almost _everyone_ who needs to use this _d version already has MSVC
> and already has the Python sources.  So building there own is trivial.

True. That's how I finally figured out my problem.

> Further, "all 4 combinations" doesnt work.  As you found out painfully, is
> it _critical_ that all Python systems share the same C runtime library.
> This is the whole point of the _d fiasco - to prevent the mixing and
> matching.

How about:
python.lib/dll and msvcrt.lib/dll
python.lib/dll and msvcrtd.lib/dll
python_d.lib/dll and msvcrt.lib/dll
python_d.lib/dll and msvcrtd.lib/dll

separated into two directories: msvcrt and msvcrtd

> We obviously need to document this process better - Im not sure where tho -
> what documentation did you use to get this far?

Not much, just figured it out myself mostly. I was only off by one character
after all: msvcrtd.lib instead of msvcrt.lib.

> It is also worth noting that Gordon pointed this out to you before this
> particular thread, and you still had the problem.  Im not sure that
> documenting it would be effective in all cases.

He said to use the Multithreaded DLL. Unfortunately, msvcrt.dll and msvcrtd.dll
are *both* the Multithreaded DLL; one is debug the other is not. It never
occured to me (well, it finally did) that it mattered whether msvcrt.dll or
msvcrtd.dll were used. I assumed that the semantics of the two DLLs were
essentially the same, just the implementation differed slightly. I'm pretty sure
(though I haven't tested it, maybe you'll know) that you can mix and match
optimized and debug code pretty easily under Unix.

> > Don't get me wrong; I think
> >it's a great service to provide the pre-compiled package. I just want to
>
> Well, FWIW, I will be making these _d versions (and all the win32 extensions
> _d versions) available in a seperate .zip file as a Registered User benefit
> (http://starship.python.net/crew/mhammond/registration).  I havent started
> this particular benefit yet tho.
>
> Mark.

I think I'll just build it myself from now on, though thanks for the service. I
usually have trouble compiling windows software but Python was smooth as smooth
can be.






More information about the Python-list mailing list