[C++-sig] Re: .def(str(self)) compile problems

Tony Djordjevski tony at v-sim.com
Wed Feb 23 00:42:00 CET 2005


Simon Burton <simon <at> arrowtheory.com> writes:

> 
> OK, I think I fixed this problem. It is dependant on the set of includes used.
> 
> This works (from boost/libs/python/test/operators.cpp )
> 
> #include <boost/python/operators.hpp>
> #include <boost/python/class.hpp>
> #include <boost/python/module.hpp>
> #include <boost/python/def.hpp>
> 
> #include <boost/python/module.hpp>
> #include <boost/python/class.hpp>
> #include <boost/python/operators.hpp>
> #include <boost/operators.hpp>
> 
> But as soon as this is used:
> 
> #include <boost/python.hpp>
> 
> the compile fails with previously reported errors.
> 
> This has got to be a bug ?
> 
> Simon.
> 

Simon,

I had the same difficulties about 1 week ago, but I'm using Boost v1.31.0 with
VC 7.1.  After searching the news group, I noticed that many of the older posts
wrote their def as follows:

    .def(self_ns::str(self))

On a whim, I tried it out, and it worked for me.  As far as the include files
go, I'm just using the atypical:

    #include <boost/python.hpp>

This might be another valid workaround you might be interested in trying.


Tony




More information about the Cplusplus-sig mailing list