please include python26_d.lib in the installer

Johan Compen johanc at gmail.com
Mon Mar 30 14:18:09 EDT 2009


On Sat, Mar 28, 2009 at 1:17 AM, Mark Hammond <skippy.hammond at gmail.com> wrote:
>> Please note: I want to build my own code in Debug mode for debugging.
>> I don't want to build or use the debug version of Python. I also can't
>
> Python does this on purpose so you don't accidentally mix different versions
> of the C runtime library.  This would happen ff you defined DEBUG in your
> code but use Python built without DEBUG - Python using a different name for
> its lib prevents this.
>
> Note that just shipping the _d.lib wouldn't help - you would need the _d.dll
> itself, plus *all* extension modules you use - *all* .pyd/.dll etc files
> have the trailing _d, and a debug version of Python refuses to load the
> release versions without the _d.
>
> I'd recommend leaving DEBUG etc disbled, but enable debug information and
> disable optimizations while debugging.

If Python doesn't include the _d.lib file, then why does the header
file reference it? I would prefer manual control over which lib file
to use. (And I don't want to disable _DEBUG for other reasons).

Could the header file be changed so it alwas uses the release lib? In
most cases it's actually ok to mix different versions of the CRT in
one application. See the following blog post about this issue:

http://www.davidlenihan.com/2008/01/choosing_the_correct_cc_runtim.html

The goal is to use one runtime library throughout your entire application.

That is nearly impossible since you typically don't have control of
which runtime library other libraries use.

It turns out is is OK to mix runtime libraries *except* in certain
cases. A well written library should avoid these cases and then it
doesn't matter if the runtime libraries match. Libraries that cannot
avoid these cases should ship with 4 versions of their libraries that
match the 4 versions of the runtime libraries.


P.S. If pyconfig.h really wanted to use the correct CRT, then it would
need to reference  different lib files for both VS2005 and 2008.

Johan.



More information about the Python-list mailing list