python-mapnik icon indicating copy to clipboard operation
python-mapnik copied to clipboard

mapnik4.0.4 build error

Open hexiaobai2012 opened this issue 10 months ago • 0 comments

Hello, I got an error during the pip install phase, Mapnik version: 4.0.4.

log: src/mapnik_gamma_method.cpp: In function ‘void export_gamma_method()’: src/mapnik_gamma_method.cpp:39:33: error: ‘GAMMA_POWER’ is not a member of ‘mapnik’; did you mean ‘mapnik::gamma_method_enum::GAMMA_POWER’? 39 | .value("POWER", mapnik::GAMMA_POWER) | ^~~~~~~~~~~ In file included from src/mapnik_gamma_method.cpp:31: /usr/local/include/mapnik/symbolizer_enumerations.hpp:167:5: note: ‘mapnik::gamma_method_enum::GAMMA_POWER’ declared here 167 | GAMMA_POWER, // agg::gamma_power | ^~~~~~~~~~~ src/mapnik_gamma_method.cpp:40:33: error: ‘GAMMA_LINEAR’ is not a member of ‘mapnik’; did you mean ‘mapnik::gamma_method_enum::GAMMA_LINEAR’? 40 | .value("LINEAR",mapnik::GAMMA_LINEAR) | ^~~~~~~~~~~~ In file included from src/mapnik_gamma_method.cpp:31: /usr/local/include/mapnik/symbolizer_enumerations.hpp:168:5: note: ‘mapnik::gamma_method_enum::GAMMA_LINEAR’ declared here 168 | GAMMA_LINEAR, // agg::gamma_linear | ^~~~~~~~~~~~ src/mapnik_gamma_method.cpp:41:32: error: ‘GAMMA_NONE’ is not a member of ‘mapnik’; did you mean ‘mapnik::gamma_method_enum::GAMMA_NONE’? 41 | .value("NONE", mapnik::GAMMA_NONE) | ^~~~~~~~~~ In file included from src/mapnik_gamma_method.cpp:31: /usr/local/include/mapnik/symbolizer_enumerations.hpp:169:5: note: ‘mapnik::gamma_method_enum::GAMMA_NONE’ declared here 169 | GAMMA_NONE, // agg::gamma_none | ^~~~~~~~~~ src/mapnik_gamma_method.cpp:42:37: error: ‘GAMMA_THRESHOLD’ is not a member of ‘mapnik’; did you mean ‘mapnik::gamma_method_enum::GAMMA_THRESHOLD’? 42 | .value("THRESHOLD", mapnik::GAMMA_THRESHOLD) | ^~~~~~~~~~~~~~~ In file included from src/mapnik_gamma_method.cpp:31: /usr/local/include/mapnik/symbolizer_enumerations.hpp:170:5: note: ‘mapnik::gamma_method_enum::GAMMA_THRESHOLD’ declared here 170 | GAMMA_THRESHOLD, // agg::gamma_threshold | ^~~~~~~~~~~~~~~ src/mapnik_gamma_method.cpp:43:36: error: ‘GAMMA_MULTIPLY’ is not a member of ‘mapnik’; did you mean ‘mapnik::gamma_method_enum::GAMMA_MULTIPLY’? 43 | .value("MULTIPLY", mapnik::GAMMA_MULTIPLY) | ^~~~~~~~~~~~~~ In file included from src/mapnik_gamma_method.cpp:31: /usr/local/include/mapnik/symbolizer_enumerations.hpp:171:5: note: ‘mapnik::gamma_method_enum::GAMMA_MULTIPLY’ declared here 171 | GAMMA_MULTIPLY, // agg::gamma_multiply | ^~~~~~~~~~~~~~ In file included from src/mapnik_gamma_method.cpp:32: src/mapnik_enumeration.hpp: In instantiation of ‘void mapnik::enumeration_<EnumWrapper>::init() [with EnumWrapper = mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>]’: src/mapnik_enumeration.hpp:51:9: required from ‘mapnik::enumeration_<EnumWrapper>::enumeration_(const char*) [with EnumWrapper = mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>]’ src/mapnik_gamma_method.cpp:38:64: required from here src/mapnik_enumeration.hpp:80:47: error: ‘MAX’ is not a member of ‘mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>’ 80 | for (unsigned i = 0; i < EnumWrapper::MAX; ++i) | ^~~ src/mapnik_enumeration.hpp:83:54: error: ‘get_string’ is not a member of ‘mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>’ 83 | base_type::value( EnumWrapper::get_string( i ), native_type( i ) ); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ src/mapnik_enumeration.hpp: In instantiation of ‘static PyObject* mapnik::enumeration_<EnumWrapper>::converter::convert(const EnumWrapper&) [with EnumWrapper = mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>; PyObject = object]’: /usr/local/include/boost/python/converter/as_to_python_function.hpp:27:61: required from ‘static PyObject* boost::python::converter::as_to_python_function<T, ToPython>::convert(const void*) [with T = mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>; ToPython = mapnik::enumeration<mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup> >::converter; PyObject = object]’ /usr/local/include/boost/python/to_python_converter.hpp:83:9: required from ‘boost::python::to_python_converter<T, Conversion, has_get_pytype>::to_python_converter() [with T = mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>; Conversion = mapnik::enumeration<mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup> >::converter; bool has_get_pytype = false]’ src/mapnik_enumeration.hpp:78:24: required from ‘void mapnik::enumeration_<EnumWrapper>::init() [with EnumWrapper = mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>]’ src/mapnik_enumeration.hpp:51:9: required from ‘mapnik::enumeration_<EnumWrapper>::enumeration_(const char*) [with EnumWrapper = mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>]’ src/mapnik_gamma_method.cpp:38:64: required from here src/mapnik_enumeration.hpp:71:20: error: invalid ‘static_cast’ from type ‘const mapnik::enumeration<mapnik::gamma_method_enum, mapnik::gamma_method_e_to_string, mapnik::gamma_method_e_from_string, mapnik::gamma_method_e_lookup>’ to type ‘long int’ 71 | , static_cast( v )); | ^~~~~~~~~~~~~~~~~~~~~~ error: command '/usr/bin/c++' failed with exit code 1

MAX is not a member of mapnik::enumeration. get_string is not a member of mapnik::enumeration. Invalid static_cast from type const mapnik::enumeration to type long int.

what should I do, please advise.

hexiaobai2012 avatar Dec 27 '24 08:12 hexiaobai2012