Embedded Python interpreter, runtime libs, and crashing

Discussion in 'Python' started by Peter Newman, Oct 26, 2005.

  1. Peter Newman

    Peter Newman Guest

    I'm embedding a Python interpreter into a project, and compiling with
    MSVC. It all runs great in the "Debug" configuration, but everything
    gets scary when I switch to "Release".

    I've read about things that can go wrong when you use the wrong runtime
    library when compiling a program that uses Python. I've done my best to
    follow the suggestions I've read, but I still seem to be having trouble.
    Here's a summary of how I've configured my project:

    Release:
    ========
    - C/C++->Code Generation->Runtime Library: Multithreaded DLL
    - Linker->Input->Additional Dependencies: ... python24.lib
    - Output EXE runs beside Python24.dll

    Debug:
    ======
    - C/C++->Code Generation->Runtime Library: Multithreaded Debug DLL
    - Linker->Input->Additional Dependencies: ... python24_d.lib
    - Output EXE runs beside Python24_d.dll


    The debug configuration works flawlessly. Release is another story
    altogther. It usually crashes with a segmentation fault or access
    violation (reading memory address 0). At one point it ran, but the code
    seemed to be executing in the wrong order (stuff getting called before
    initialization functions were finished, etc.)


    --
    Peter Newman ()
     
    Peter Newman, Oct 26, 2005
    #1
    1. Advertising

  2. Peter Newman

    Guest

    > It all runs great in the "Debug" configuration, but
    > everything gets scary when I switch to "Release".


    My suggestion would be to turn on debug information
    for the release build.

    That would at least let you run the release build inside
    the debugger, allowing you to see the call stack of the
    offending crash.

    Jussi Jumppanen
    Author: Zeus for Windows Programmer's IDE
    http://www.zeusedit.com
     
    , Oct 26, 2005
    #2
    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. Christoph
    Replies:
    2
    Views:
    554
    Richard Bos
    Sep 17, 2003
  2. Leeuw van der, Tim
    Replies:
    1
    Views:
    288
    Stefan Behnel
    Feb 2, 2005
  3. Replies:
    3
    Views:
    786
    Ziga Seilnacht
    Jan 3, 2007
  4. Raman
    Replies:
    5
    Views:
    1,091
    Raman
    May 9, 2008
  5. Greg Hauptmann
    Replies:
    4
    Views:
    227
    Stefano Crocco
    Feb 7, 2009
Loading...

Share This Page