FAQ
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

Search Discussions

  • Nathan Coulson at Mar 16, 2011 at 12:00 am
    Recompiling SDL, using --disable-stdio-redirect fixed this problem.
    On Tue, Mar 15, 2011 at 1:48 AM, Nathan Coulson wrote:
    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 (conathan)
    ------
    Location: British Columbia, Canada
    Timezone: PST (-8)
    Webpage: http://www.nathancoulson.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMar 15, '11 at 8:48a
activeMar 16, '11 at 12:00a
posts2
users1
websitepython.org

1 user in discussion

Nathan Coulson: 2 posts

People

Translate

site design / logo © 2022 Grokbase