debug Python interpreter work with the debug swig dll

Greg Landrum gReGlAnDrUm at earthlink.net
Fri Aug 31 09:36:50 EDT 2001


"Irina Kotlova" <Irina.Kotlova at lhsl.com> wrote in message
news:97592a5.0108310521.3c226a62 at posting.google.com...
> Hello All,
>
> Could anyone advise how to make debug Python interpreter "python_d" to
> import the previously built dll with a module? The module is the
> interface file "employee.i" with the simple C++ class inside. The dll
> build procedure consists of swig generating wrappers for Python and
> then compiling and linking of a class along with the wrappers.
>

One of the joys of developing under windows is that when you use python_d,
*all* extension module DLLs used must be debug versions.  This means they
all have to have _d appended to their names.[1]

If you modify your project to produce employee_d.dll (or .pyd, or whatever)
when building in Debug mode things should be okay.

Well, at least until you try to import some other extension module that you
don't have a debug version of.

Note: if you are just interested in debugging your *own* code (not Python
itself), you are perfectly safe just using standard python (not python_d).
You can set a breakpoint in your code and have MSVC invoke python on some
script which calls the relevant methods and everything will work fine.

-greg
[1] My initial experience with this a couple of years ago caused me to curse
the names of the python-powers-that-be quite loudly until Mark Hammond
calmly explained to me why it was required.  I don't really remember his
explanation, but it must have been good because my acceptance continues to
this day.





More information about the Python-list mailing list