Boost logo

Boost Users :

From: Robert Dailey (rcdailey_at_[hidden])
Date: 2008-02-20 17:36:03


Hi,

When I execute the following code:

BEGIN CODE
--------------------------------------------------
#define BOOST_PYTHON_DEF( func ) boost::python::def( #func, func )

using namespace boost::python;

static char const* PrintHelloWorld()
{
    return "Hello World!";
}

BOOST_PYTHON_MODULE(Script)
{
    BOOST_PYTHON_DEF( PrintHelloWorld );
}

void BeginPythonTest()
{
    try
    {
        Py_Initialize();

        initScript();

        Py_Finalize();
    }

    catch( error_already_set const& /*err*/ )
    {
        PyErr_Print();
    }

    catch( std::invalid_argument const& /*err*/ )
    {
        PyErr_Print();
    }
}
--------------------------------------------------
END CODE

I receive the following error message:
*Fatal Python error: Interpreter not initialized (version mismatch?)*

This occurs when I step over the call to initScript() (in the code snippet
above). I have no idea why this is happening. I'm currently linking against
boost 1.34.1. I built all the libraries for boost myself using bjam. I built
the multithreaded debug and release shared libraries. I'm using the SDK from
Python 2.5.1. I also built the debug and release shared libraries for Python
myself.

My operating system is Microsoft Windows XP Professional.

All help is appreciated. Thanks in advance!



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net