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

N

Nathan Coulson

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top