On 2011-01-15 09:01, Michael Wand wrote:
int main() {
     boost::python::list myList;
     myList.append("foo");
     myList.append("fork");
     cerr<<  "Printing length of list."<<  endl;
     cerr<<  "Length of myList: "<<  boost::python::len(myList)<<  endl;
// the above line causes a segfault!
     cerr<<  "TheList: "<<  boost::python::extract<string>(myList[0])()<<  ","
                   <<  boost::python::extract<string>(myList[1])()<<  endl;
     cerr<<  "Finished"<<  endl;
}

You haven't initialized the Python runtime with "Py_Initialize()".

    Stefan



--

      ...ich hab' noch einen Koffer in Berlin...

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to