Py_Initialize() fails on windows when SDL.h is included.

Discussion in 'Python' started by Nathan Coulson, Mar 15, 2011.

  1. I began porting one of my projects from linux (no problems under
    linux) to windows, but I am getting the following problem when
    attempting to run it (This was within gdb)

    warning: Fatal Python error:
    warning: Py_Initialize: can't initialize sys standard streams
    warning:


    I narrowed it down the following testcase,

    #include <SDL/SDL.h>
    #include <Python.h>

    int main(int argc, char*argv[])
    {
    Py_Initialize();
    }

    commenting out the first include (SDL/SDL.h) allows it to run w/o any problems.

    SDL-1.2.13, Python 3.1.3 (Also tested w/ 3.2.), GCC 4.5.1,
    w32api-3.17.1, mingw-rt-3.18 (Toolchain is a linux to windows cross
    compiler, designed from
    http://nathancoulson.com/proj_cross_mingw.shtml)

    I noticed when I mess with the include order (Python.h before SDL.h), it gives

    3rdparty/i686-pc-mingw32/include/SDL/SDL_config.h:131:0: warning:
    "HAVE_SNPRINTF" redefined
    3rdparty/i686-pc-mingw32/include/python3.2/pyerrors.h:361:0: note:
    this is the location of the previous definition

    it is defined in SDL_config.h as
    #define HAVE_SNPRINTF 1

    although no clue if it's related... probably a red herring

    --
    Nathan Coulson (conathan)
    ------
    Location: British Columbia, Canada
    Timezone: PST (-8)
    Webpage: http://www.nathancoulson.com
     
    Nathan Coulson, Mar 15, 2011
    #1
    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. Wiktor Sadowski
    Replies:
    1
    Views:
    251
    =?UTF-8?B?0LTQsNC80ZjQsNC9INCzLg==?=
    Dec 18, 2003
  2. Wiktor Sadowski
    Replies:
    4
    Views:
    346
    Lothar Scholz
    Dec 24, 2003
  3. Roman Suzi
    Replies:
    0
    Views:
    449
    Roman Suzi
    Jan 8, 2005
  4. Roman Suzi
    Replies:
    0
    Views:
    386
    Roman Suzi
    Jan 10, 2005
  5. Markus Heller

    Py_Initialize(); undefined reference...

    Markus Heller, Dec 22, 2005, in forum: Python
    Replies:
    1
    Views:
    2,316
    Markus Heller
    Dec 22, 2005
Loading...

Share This Page