Debugging C++ code called from Python 2.2 with Visual Studio.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • egodet@equisys.com

    #1

    Debugging C++ code called from Python 2.2 with Visual Studio.NET

    Hi,
    I'm trying to debug some VS native C++ code called from a python script
    (version is 2.2).
    For that, I added the _DEBUG macro in Setup.py but when I rebuild the
    pyd file, I get a compilation error whereby it says that python22_d.lib
    could not be found.

    I've seen in various groups that python22_d.lib is not available for
    download anymore but that it is easy to recompile. Could someone send
    it to me, explain how to build it or, even better, both.

    I expect that after that, if I recompile the python pyd file, I will be
    able to attach a debugger to it. Could someone confirm this?

    Cheers,
    Emmanuel

    PS: I'm new to Python and I'm using legacy code.

  • Fredrik Lundh

    #2
    Re: Debugging C++ code called from Python 2.2 with Visual Studio.NET

    egodet@equisys. com wrote:
    [color=blue]
    > I've seen in various groups that python22_d.lib is not available for
    > download anymore but that it is easy to recompile. Could someone send
    > it to me, explain how to build it or, even better, both.[/color]

    load the project file (under PCbuild), select the debug targets, and build them.

    </F>



    Comment

    • olsongt@verizon.net

      #3
      Re: Debugging C++ code called from Python 2.2 with Visual Studio.NET


      egodet@equisys. com wrote:[color=blue]
      > Hi,
      > I'm trying to debug some VS native C++ code called from a python script
      > (version is 2.2).
      > For that, I added the _DEBUG macro in Setup.py but when I rebuild the
      > pyd file, I get a compilation error whereby it says that python22_d.lib
      > could not be found.
      >
      > I've seen in various groups that python22_d.lib is not available for
      > download anymore but that it is easy to recompile. Could someone send
      > it to me, explain how to build it or, even better, both.
      >
      > I expect that after that, if I recompile the python pyd file, I will be
      > able to attach a debugger to it. Could someone confirm this?
      >
      > Cheers,
      > Emmanuel
      >
      > PS: I'm new to Python and I'm using legacy code.[/color]

      To elaborate on Frederick's advice, the source .tgzs available on
      python.org contain everything you need to build the windows version,
      excluding a few modules that require third-party dependancies (tkinter,
      ssl, zip, bzip2 and probably a few others). You'll need VC6.0 as well
      for 2.2.

      Comment

      • egodet@equisys.com

        #4
        Re: Debugging C++ code called from Python 2.2 with Visual Studio.NET

        I can't seem to be able to download
        http://www.python.org/ftp/python/2.2/Python-2.2.tgz.
        Do you know if I can find it elsewhere?
        Thanks,
        Emmanuel

        Comment

        • olsongt@verizon.net

          #5
          Re: Debugging C++ code called from Python 2.2 with Visual Studio.NET


          egodet@equisys. com wrote:[color=blue]
          > I can't seem to be able to download
          > http://www.python.org/ftp/python/2.2/Python-2.2.tgz.
          > Do you know if I can find it elsewhere?
          > Thanks,
          > Emmanuel[/color]

          The link you gave worked for me...

          Comment

          Working...