[C++-sig] compiler error during boost.python tutorial (exposing class World), wrong number of template arguments

ckim at etri.re.kr ckim at etri.re.kr
Wed Sep 9 05:08:16 EDT 2020


Hello all,

I was following the boost.python tutorial but have this compile error that I
don't know how to solve.

The compiler says I need 4 template parameters for the class exposing class_
definition, but I only have one. (the other three are optional, aren't
they?)

 

BOOST_PYTHON_MODULE(world_ext)

{

    using namespace boost::python;

    class_<World>("World")

        .def("greet", &World::greet)

        .def("set", &World::set)

    ;

}

I have asked the question on
https://stackoverflow.com/questions/63803975/compile-error-during-boost-pyth
on-tutorial-error-wrong-number-of-template-argu. 

If someone please tell me how to fix it, I would deeply appreciate it. 

Thank you.

 

BTW, the tutorial is so old and doesn't fit with current boost code, and
even the build method is different from the tutorial.
For beginners to boost.python, it will take unnecessarily long to catch
things.

 

Chan Kim, Principal Research Member

Processor Research Team, Intelligent Semiconductor Research

ETRI(Electronics and Telecommunications Research Institute)

O) +82-42-860-5773  C) +82-10-3418-9152  E)  <mailto:ckim at etri.re.kr>
ckim at etri.re.kr

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20200909/2ef52563/attachment.html>


More information about the Cplusplus-sig mailing list