Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2008-07-07 12:51:58


on Mon Jul 07 2008, "Tony May" <tmay-AT-infoinplace.net> wrote:

> Is it possible to use the pre-built binaries with MSVC++ 2005 express edition?
> I get the following error from bjam when attempting to build the pyd from the
> source file hello.cpp.
>
> -----------------------------------------------------
>
> hello.cpp has the following code trying to
> wrap a class
>
> BOOST_PYTHON_MODULE(hello_ext)
> {
> class_<GreetBase>("GreetBase") # line 50
> .def("greet", &GreetBase::greet)
> ;
> }
>
> --------------------------------------------
>
> hello.cpp(50) : error C2976: 'boost::python::class_' : too few template arguments
>
> C:\Program Files\boost\boost_1_35_0\boost/python/def_visitor.hpp(14) :
> see declaration of 'boost::python::class_'
>
> hello.cpp(50) : error C2440: '<function-style-cast>' :
> cannot convert from 'const char [10]' to 'boost::python::class_'
>
> Source or target has incomplete type
> hello.cpp(50) : error C2228: left of '.def' must have class/struct/union
>
> ------------------------------------------------
> Do I need to rebuild the boost libraries? Would this be expected to fix the problem?

This looks like a failure to include the necessary header files.

Try

  #include "boost/python/class.hpp"

at the top of your file.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net