Fatal Error in the interpreter?
Mark Hammond
MarkH at ActiveState.com
Tue Dec 11 18:18:13 EST 2001
Courageous wrote:
> On Tue, 11 Dec 2001 21:30:14 +1100 (EDT), Andrew MacIntyre
> <andymac at bullseye.apana.org.au> wrote:
>
>
>>On Mon, 10 Dec 2001, Courageous wrote:
>>
>>
>>>I'm currently using the Debug build from Python as checked
>>>out of the current CVS branch (Python22). I have an extension
>>>that I've written and compiled successfully, but when I import
>>>it, the interpreter crashes: "Fatal Error: Interpreter not
>>>initialized (version mismatch?)"
>>>
>
>>>Upon introspection, it appears that the program is crashing
>>>from within Py_InitModule().
>>>
>
>>The one time I saw this (on OS/2 so it may not translate), ISTR that I was
>>trying to explicitly load the Python DLL, rather than rely on linkage via
>>an import library.
>>
>
> It appears to somehow be associated with some confusion over
> python22_d.lib and the likes. Only I believe that I should be
> getting the _d.lib when I build in VC, and that should be the
> one I'm picking up when I run the interpreter.
>
> There must be something I don't know. Do I have to explicitly
> define a flag? I'd think that the VC build should be able to
> pick up on my build configuration -- debug mode.
This magic happens in pyconfig.h. The pre-processor _DEBUG triggers
both Py_DEBUG, and the default use of the "_d" library.
_DEBUG is defined by default in MSVC Debug builds - so it *should* just
work. Indeed, it generally does <wink>
Mark.
More information about the Python-list
mailing list