How to use boost::python::dict or tuple in main function?

Viewed 3807

When I use boost::python::tuple or boost::python::dict in main function, the program crash!

#define BOOST_PYTHON_STATIC_LIB
#include <boost/python.hpp>
#include <iostream>
#include <boost/python/tuple.hpp>
#include <boost/python/dict.hpp>

//using namespace std;
using namespace boost::python;

int main()
{
    //tuple x;
    //x = make_tuple(object(0),object(1));
    dict x;
    x["123"] = 3;
    return 0;
}

But when I use them in .dll, it is ok, what's wrong?

1 Answers
Related