Boost logo

Boost Users :

From: Huang You Gong (huangyougong_at_[hidden])
Date: 2008-01-14 05:36:01


Hi,

I try to use boost.python to invoke C++ library in Python, so I need to
expose types and classes.
Here is the c++ head file:

 *typedef int XTYPE;*
*class XCLASS*
*{*
*public:*
* XTYPE getvalue( void ){ return XTYPE( 3 ); }*
*};*

So I write exposing code in BOOST_PYTHON_MODULE like this:

 *BOOST_PYTHON_MODULE( x )*
*{*
* class_< XCLASS >( "XCLASS" )*
* .def( "getvalue", &XCLASS::getvalue, return_value_policy<
copy_non_const_reference >() )*
* ;*
*}*

but there is compiling error as using of undefined type.
what shall I do to make the type XTYPE known by boost.python?
Thanks in advance!

-- 
Huang You Gong


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net