Boost logo

Boost :

From: Xavier Warin (xavier.warin_at_[hidden])
Date: 2001-04-10 02:24:51

While trying to bind C++ with Python by BPL, i get the following error
with KCC (it works with GCC) :

error: no instance of overloaded function
          "boost::python::class_builder<T, U>::def [with T=Data,
          U=boost::python::detail::held_instance<Data>]" matches the
            argument types are: (<unknown-type>, const char [8])
      Data_class.def(&Data::get_val, "get_val");
on the following example :

class Data {
private :
  const double w ;
public :
  Data( double v ) : w(v) {} ;
  ~Data() {}

  double get_val() { return 1; }
  double get_val(double x) { return x+1 ;}
} ;

extern "C"
void initriskneut()
    // Create an object representing this extension module.
    python::module_builder this_module("alltest");

    // Create the Python type object
    boost::python::class_builder< Data > Data_class(this_module, "Data"
    Data_class.def(boost::python::constructor< double >());
    Data_class.def(&Data::get_val, "get_val");
    boost::python::handle_exception(); // Deal with the exception for

This error only happens when get_val has two definitions (in the data
Do you think it's a KCC bug or a BPL bug.
Thank you


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