python23_d.lib

Discussion in 'Python' started by Shankar KN, Jun 11, 2004.

  1. Shankar KN

    Shankar KN Guest

    Hi,

    I am trying to get a hand on python23_d.lib but in vain.
    I am developing a C++ dll which has a SWIG interface to the Python world.
    After installing Python and SWIG I am able to build this DLL in Release mode
    but not in Debug mode beacuse of non-availability of python23_d.lib.

    Any clues as to how I could proceed with Debug build?

    Thanks,
    With best regards,
    Shankar
    Shankar KN, Jun 11, 2004
    #1
    1. Advertising

  2. Shankar KN

    Gary Herron Guest

    On Friday 11 June 2004 09:59 am, Shankar KN wrote:
    > Hi,
    >
    > I am trying to get a hand on python23_d.lib but in vain.
    > I am developing a C++ dll which has a SWIG interface to the Python world.
    > After installing Python and SWIG I am able to build this DLL in Release
    > mode but not in Debug mode beacuse of non-availability of python23_d.lib.
    >
    > Any clues as to how I could proceed with Debug build?
    >
    > Thanks,
    > With best regards,
    > Shankar


    I just copied python23.lib to the proper spot renaming it to
    python23_d.lib. I suppose this is not an ideal solution, but it did
    shutup the complaints so I could proceed.

    Perhaps someone (else) can provide a "real" solution,

    Gary Herron
    Gary Herron, Jun 11, 2004
    #2
    1. Advertising

  3. "Shankar KN" <> writes:

    > Hi,
    >
    > I am trying to get a hand on python23_d.lib but in vain.
    > I am developing a C++ dll which has a SWIG interface to the Python world.
    > After installing Python and SWIG I am able to build this DLL in Release mode
    > but not in Debug mode beacuse of non-availability of python23_d.lib.
    >
    > Any clues as to how I could proceed with Debug build?


    Get the Python sources and make a debug build.

    Thomas
    Thomas Heller, Jun 11, 2004
    #3
  4. Shankar KN

    Steve Menard Guest

    Shankar KN wrote:
    > Hi,
    >
    > I am trying to get a hand on python23_d.lib but in vain.
    > I am developing a C++ dll which has a SWIG interface to the Python world.
    > After installing Python and SWIG I am able to build this DLL in Release mode
    > but not in Debug mode beacuse of non-availability of python23_d.lib.
    >
    > Any clues as to how I could proceed with Debug build?
    >
    > Thanks,
    > With best regards,
    > Shankar
    >
    >


    What I usually is grab the sources and create a debug build myself.
    SHould be pretty easy and painless to do no matter what platform you
    use. keep in mind its not only the python23_d.lib that you need, but
    also the python_d.exe and python23_d.dll, along with _d version of any
    extension modules you use.

    python the _d versions in the same place you find the regular works for me.

    Steve
    Steve Menard, Jun 11, 2004
    #4
  5. Shankar KN

    Bryan Guest

    Shankar KN wrote:
    > Hi,
    >
    > I am trying to get a hand on python23_d.lib but in vain.
    > I am developing a C++ dll which has a SWIG interface to the Python world.
    > After installing Python and SWIG I am able to build this DLL in Release mode
    > but not in Debug mode beacuse of non-availability of python23_d.lib.
    >
    > Any clues as to how I could proceed with Debug build?
    >
    > Thanks,
    > With best regards,
    > Shankar
    >
    >


    this is the simplest approach i've found. i just add this around the python.h include.

    #ifdef _DEBUG
    #include <Python.h>
    #define _DEBUG
    #else
    #include <Python.h>
    #endif


    bryan
    Bryan, Jun 12, 2004
    #5
  6. Shankar KN

    Miki Tebeka Guest

    Hello Bryan,

    > this is the simplest approach i've found. i just add this around the
    > python.h include.
    >
    > #ifdef _DEBUG

    I think the following line is missing.
    #undef _DEBUG
    > #include <Python.h>
    > #define _DEBUG
    > #else
    > #include <Python.h>
    > #endif


    Bye.
    --
    -------------------------------------------------------------------------
    Miki Tebeka <>
    The only difference between children and adults is the price of the toys.
    Miki Tebeka, Jun 13, 2004
    #6
  7. Shankar KN

    Bryan Guest

    Miki Tebeka wrote:
    > Hello Bryan,
    >
    >
    >>this is the simplest approach i've found. i just add this around the
    >>python.h include.
    >>
    >>#ifdef _DEBUG

    >
    > I think the following line is missing.
    > #undef _DEBUG
    >
    >>#include <Python.h>
    >>#define _DEBUG
    >>#else
    >>#include <Python.h>
    >>#endif

    >
    >
    > Bye.
    > --


    yes, of course... sorry, i shoud have copied it from me code instead of just writing it here.

    thanks,

    bryan
    Bryan, Jun 13, 2004
    #7
  8. Shankar KN

    Shankar KN Guest

    Hi,

    Thanks for the reply.
    But the problem persists.

    There is only place where I do a #include <Python.h> (its in a .i file)
    I did what you suggested around this include.

    the problem is that running SWIG on this .i generates a .cxx file which we
    don't want to modify.
    This .cxx file has multiple occurences of #include <Python.h>, and only one
    occurence gets the "guard" against _DEBUG.

    Am I missing something here?


    "Bryan" <> wrote in message
    news:...
    > Miki Tebeka wrote:
    > > Hello Bryan,
    > >
    > >
    > >>this is the simplest approach i've found. i just add this around the
    > >>python.h include.
    > >>
    > >>#ifdef _DEBUG

    > >
    > > I think the following line is missing.
    > > #undef _DEBUG
    > >
    > >>#include <Python.h>
    > >>#define _DEBUG
    > >>#else
    > >>#include <Python.h>
    > >>#endif

    > >
    > >
    > > Bye.
    > > --

    >
    > yes, of course... sorry, i shoud have copied it from me code instead of

    just writing it here.
    >
    > thanks,
    >
    > bryan
    Shankar KN, Jun 15, 2004
    #8
  9. Shankar KN

    Bryan Guest

    Shankar KN wrote:
    > Hi,
    >
    > Thanks for the reply.
    > But the problem persists.
    >
    > There is only place where I do a #include <Python.h> (its in a .i file)
    > I did what you suggested around this include.
    >
    > the problem is that running SWIG on this .i generates a .cxx file which we
    > don't want to modify.
    > This .cxx file has multiple occurences of #include <Python.h>, and only one
    > occurence gets the "guard" against _DEBUG.
    >
    > Am I missing something here?
    >
    >



    sorry, i don't use swig, so i'm no going be able to help you with that. but couldn't you write a python post-process
    script that modifies the file automatically when compiled debug? if this is too much of a pain, then maybe compiling a
    debug version of python would be your simplest solution.

    bryan
    Bryan, Jun 15, 2004
    #9
  10. Shankar KN

    Tonetheman Guest

    The real problem that you are having is from these lines in the
    pyconfig.h file that you include.
    #ifdef MS_COREDLL
    # ifndef Py_BUILD_CORE /* not building the core - must be an ext */
    # if defined(_MSC_VER)
    /* So MSVC users need not specify the .lib file in
    their Makefile (other compilers are generally
    taken care of by distutils.) */
    # ifdef _DEBUG
    # pragma comment(lib,"python23_d.lib")
    # else
    # pragma comment(lib,"python23.lib")
    # endif /* _DEBUG */
    # endif /* _MSC_VER */
    # endif /* Py_BUILD_CORE */
    #endif /* MS_COREDLL */

    So if you want you should be able to change your source to something
    like this:

    #undef _DEBUG
    #include <python.h>
    #define _DEBUG

    Or if you want to you could just hack up pyconfig.h to remove the
    pragma that forces the debug version library...

    Or finally just get the sources and build the debug library yourself.

    Tone



    "Shankar KN" <> wrote in message news:<caco5i$q8j$>...
    > Hi,
    >
    > I am trying to get a hand on python23_d.lib but in vain.
    > I am developing a C++ dll which has a SWIG interface to the Python world.
    > After installing Python and SWIG I am able to build this DLL in Release mode
    > but not in Debug mode beacuse of non-availability of python23_d.lib.
    >
    > Any clues as to how I could proceed with Debug build?
    >
    > Thanks,
    > With best regards,
    > Shankar
    Tonetheman, Jun 22, 2004
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Partho Bhowmick

    Missing python23_d.lib in Windows Python 2.3

    Partho Bhowmick, Sep 16, 2003, in forum: Python
    Replies:
    1
    Views:
    358
    Harri Pesonen
    Sep 16, 2003
  2. Paton J. Lewis
    Replies:
    1
    Views:
    667
    Mark Hammond
    Jan 30, 2004
  3. Thomas Heller

    Re: python23_d.lib

    Thomas Heller, Jun 22, 2004, in forum: Python
    Replies:
    0
    Views:
    380
    Thomas Heller
    Jun 22, 2004
  4. Miki Tebeka

    Re: python23_d.lib

    Miki Tebeka, Jun 23, 2004, in forum: Python
    Replies:
    0
    Views:
    369
    Miki Tebeka
    Jun 23, 2004
  5. Antoine Maillard
    Replies:
    1
    Views:
    332
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Aug 2, 2004
Loading...

Share This Page