Boost logo

Boost :

Subject: Re: [boost] [python] Setting a pointer into an object
From: Robert Dailey (rcdailey_at_[hidden])
Date: 2008-09-30 17:05:46

On Tue, Sep 30, 2008 at 3:14 PM, David Abrahams <dave_at_[hidden]> wrote:
> Just wrap the class without exposing any of its interesting parts and
> you should be fine:
> class_<SomeClassOfMine>("SomeClassOfMine");

Thanks David.

After I posted my original inquiry I found out through PyErr_Print()
that it needed the class to be exposed to Python. However, I no longer
wish to expose the class, but instead I want to define a global
function in a python script that I'm loading.

For example, I would add this function to the namespace that I pass
into exec_file().

The C++ function I want to expose looks like:

static Rocket::Core::Context* GetContext( std::string const& context_name );

All I'm doing is this:

boost::python::object MyNewFunction( &GetContext );

However, when I compile this I get:

error C2027: use of undefined type

I can't exactly use return policies here since I'm not using def().
How can I make this work?

Boost list run by bdawes at, gregod at, cpdaniel at, john at