Still got the same error. However, after looking at add_property, I wrapped the struct with a class that implemented setters and getters for the bitfields, thusly:
Then I used add_property to expose the setters and getters as the name of the property in question:
Without trying to sound like too much of a whiner, this seems like a lot of work. Is this what you had in mind?
> Date: Sat, 6 Apr 2013 13:03:55 -0700
> From: watanabesj@gmail.com
> To: boost-users@lists.boost.org
> Subject: Re: [Boost-users] c++ Bit Fields
>
> AMDG
>
> On 04/05/2013 08:19 AM, Chris Gem wrote:
> > Please forgive me if this question has been answered but I've searched for days now and cannot find it.
> >
> > How do I expose a c++ struct with a bit field to python using boost::python?
> >
> > When I try I get this error.
> >
> > error: invalid pointer to bit-field ‘frameHdr_s::hdrSize’
> >
>
> You can't take that address of a bitfield. You'll
> have to use add_property directly.
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users@lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users