Problems embedding with win2k

Chris Tavares christophertavares at earthlink.net
Mon Mar 18 17:51:05 EST 2002


"Mark" <mrussell8081 at pacbell.net> wrote in message
news:3a7925ca.0203181215.626e8ea3 at posting.google.com...
> I need to embed a python interpreter in C++ applications in both Win2K
> and Linux environments.  I have started to work the embedding examples
> and have run into problems on the windows side, here is my setup and
> problem:
>
> Environment:
>
> Win2K Pro, VC6 SP4
>
> Problem 1-Very High Level Embedding Example:  Access violation in
> msvcrtd in debug mode
> I work the first example from the Python docs-extending and embedding
> sec 5.1.  When I build this in release mode the application runs fine.
>  When I compile and run in Debug mode I get an access violation in
> msvcrtd.dll.  When the program is run the following two asserts fail:
>
> Dbgheap.c line: 1044
> _CrtIsValidHeadPointer(pUserData)
> Dbgheap.c line: 1050
> _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
>
> When I look back through the trace, this error occurs when in
> Py_Initialize() when the site module is being imported.  I am using
> the debug multithreaded dll runtime for debug and the multithreaded
> dll runtime for release.  I am sure I must have a project setting
> wrong but I can't figure out exactly what.
>

This is most likely a symptom of mismatched debug vs. release libraries. Is
the *python* dll you're using compiled for debug mode? If it's not, that
would explain the access violations.

You'll need to grab the python source tree and compile a debug version on
your win32 box.

-Chris






More information about the Python-list mailing list