[C++-sig] error C2904: 'from_python' : template-name already defined

Achim Domma achim.domma at syynx.de
Sat May 25 16:50:29 CEST 2002


Hi,

still trying to wrap ImageMagick with boost.python I get the following
error:

e:\cvsroot\boost\boost/python/converter/from_python.hpp(24) : error C2904:
'from_python' : template-name already defined as '__restrict volatile const
signed  __fastcall boost::python::from_python'
e:\cvsroot\boost\boost/mpl/aux_/count_if_not.hpp(61) : fatal error C1506:
unrecoverable block scoping error

Here is the file I try to compile:

---->
#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <string>
#include <Magick++.h>
using namespace boost::python;

void add_class_Image_to_module(module& m) {
	m.add(class_<Magick::Image>("Image")
		.def_init()
		);
}
<----

I have such a file for each class, due to internal compiler errors if I put
all classes in one file. The module definition looks like this:

---->
void add_class_Image_to_module(boost::python::module& m);
BOOST_PYTHON_MODULE_INIT(ImageMagick)
{
    using namespace boost::python;
    module m("ImageMagick");
    add_class_Image_to_module(m);
}
<----

Is there something wrong with this code? I have no idea where the error
comes from.

greetings
Achim







More information about the Cplusplus-sig mailing list