[C++-sig] boost::python::make_tuple crashing

Thomas Berg merlin66b at gmail.com
Sun Jul 5 18:39:53 CEST 2009


On Sun, Jul 5, 2009 at 6:27 PM, Simon Pickles<sipickles at googlemail.com> wrote:
> Sorry, had a typo or two:
>
> int main()
> {
>   int count = 0;
>   int target = 100000;
>
>   string s = "spam";
>   unsigned char i = 42;
>   float f = 3.14f;
[snip]
>   cout << "Starting boost.python.tuple test" << endl;
>   RakNetTime bptStart = RakNet::GetTime();
>   for ( count = 0; count < target; ++count )
>   {
>       HandleBoostPythonTuple(boost::python::make_tuple(s,f,i));
>   }
>   RakNetTime bptEnd = RakNet::GetTime();
>   cout << "Duration: " << (bptEnd - bptStart) << endl;
>   return 0;
> }


You seem to miss Py_Initialize() in your example at least. The code
then runs on my machine (VS2005, boost 1.37)

Cheers,
Thomas


More information about the Cplusplus-sig mailing list