[C++-sig] object constructor + integer == fail

troy d. straszheim troy at resophonic.com
Tue Oct 13 16:12:32 CEST 2009


Daniel Löb wrote:
> Hi!
> 
> I seem to be unable to call the constructor of "object" with an integer 
> parameter.
> Working example:
> 
> #include <boost/python.hpp>
> #include <iostream>
> 
> using namespace boost::python;
> using std::cout;
> using std::endl;
> 
> int main()
> {
>     object toast(3);
>     cout << extract<int>(toast) << endl;
> }
> 
> It compiles just fine, but dies with a segmentation fault on execution 
> of the first line within main.
> 

Does calling Py_Initialize() help?

-t




More information about the Cplusplus-sig mailing list