|
Boost : |
From: limberm_at_[hidden]
Date: 2001-03-02 13:48:58
--- In boost_at_y..., "David Abrahams" <abrahams_at_m...> wrote:
> The fix is now in the CVS repository.
> BTW, how was this showing up as a symptom? My analysis shows that
the code I
> was using should have been equivalent.
>
Hi All,
I got two files from CVS: base_object.hpp and wrap_python.hpp.
I still get the same problem: object.c, _Py_ForgetReference,
op->_ob_prev = NULL.
My example is simple. I built bpl_static with BOOST_DEBUG_PYTHON
defined. I then built the following:
class Dog
{
public:
Dog(){}
~Dog(){}
};
extern "C"
{
#ifdef _WIN32
__declspec(dllexport)
#endif
void initKenel()
{
try
{
// create an object representing this extension module
boost::python::module_builder kenelModule("Kenel");
// Dog
boost::python::class_builder<Dog> Dog_class(kenelModule,
"Dog");
Dog_class.def(boost::python::constructor<>());
}
catch(...)
{
boost::python::handle_exception(); // Deal with the
exception for Python
}
}
} // extern C
int main(int argc, char **argv)
{
//Initialize the Python interpreter. Required.
Py_Initialize();
// initialize my module!
initKenel();
/* Do some application specific code */
printf("Hello, brave new world\n\n");
/* Execute some Python statements (in module __main__) */
PyRun_SimpleString("import Kenel\n");
printf("\nGoodbye, cruel world\n");
/* Exit, cleaning up the interpreter */
Py_Finalize();
return 0;
}
I made sure Python20_d.lib/dll were accessible.
I build in Debug, and run it. VC++6.0, SP4.
mark
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk