[C++-sig] C++ compile error on .def from n00b.

Roman Yakovenko roman.yakovenko at gmail.com
Sun Apr 2 06:25:08 CEST 2006


On 3/31/06, Randy Taylor <Randy.Taylor at tradingtechnologies.com> wrote:
> I'm a n00b.
> I'm trying to expose a C++ class that has a virtual mem fun with an
> implementation that I wish to override in Python.  Seems easy enough.
> Compiler disagrees, saying she does not like my def. I must be doing something
> wrong. What is it?  Thanks kindly in advance.
>

Hi. It would be nice if you could provide less source that shows your problem.

Also I think in this case ( noncopyable ) you did not setup class init
method(s).

In order to get more readable errors you can write something like this

typedef boost::python::class_< ... >  my_class_exposer_t;
my_class_exposer_t exposer( ... );
exposer.def( ... );

At least you will be pointed by compiler to the right line.

And an other thing: if you are just start with Boost.Python then try
one of available code
generators: pyplusplus ( has gui ) and/or Pyste. You will be able to
save a lot of time.


--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list