Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting error while compiling vector_tile.cpp #63

Closed
veejaykrishnan opened this issue Oct 9, 2014 · 5 comments
Closed

getting error while compiling vector_tile.cpp #63

veejaykrishnan opened this issue Oct 9, 2014 · 5 comments

Comments

@veejaykrishnan
Copy link

I am getting the following error while compiling the vector_tile.cpp

./src/vector_tile_projection.hpp:12:37: error: ‘namespace mapnik::vector { }’ redeclared as different kind of symbol
/usr/include/c++/4.6/bits/stl_vector.h:180:11: error: previous declaration of ‘template<class _Tp, class _Alloc> class std::vector’
In file included from vector_tile.cpp:20:0:
../src/vector_tile_processor.hpp:53:37: error: ‘namespace mapnik::vector { }’ redeclared as different kind of symbol
/usr/include/c++/4.6/bits/stl_vector.h:180:11: error: previous declaration of ‘template<class _Tp, class Alloc> class std::vector’
../src/vector_tile_processor.hpp: In member function ‘void mapnik::vector::processor::apply(double)’:
../src/vector_tile_processor.hpp:106:92: error: invalid initialization of reference of type ‘const mapnik::Map&’ from expression of type ‘double’
/usr/local/include/mapnik/scale_denominator.hpp:32:20: error: in passing argument 1 of ‘double mapnik::scale_denominator(const mapnik::Map&, bool)’
../src/vector_tile_processor.hpp: In member function ‘void mapnik::vector::processor::apply_to_layer(const mapnik::layer&, const mapnik::projection&, double, double, unsigned int, unsigned int, const mapnik::box2d&, int)’:
../src/vector_tile_processor.hpp:261:38: error: ‘struct mapnik::raster’ has no member named ‘premultiplied_alpha

In file included from ../src/vector_tile_backend_pbf.hpp:10:0,
from vector_tile.cpp:21:
/usr/include/mapnik/value_types.hpp: At global scope:
/usr/include/mapnik/value_types.hpp:48:8: error: redefinition of ‘struct mapnik::value_null’
/usr/local/include/mapnik/value.hpp:71:8: error: previous definition of ‘struct mapnik::value_null’
In file included from ../src/vector_tile_backend_pbf.hpp:13:0,
from vector_tile.cpp:21:
../src/vector_tile.pb.h:28:18: error: ‘namespace mapnik::vector { }’ redeclared as different kind of symbol
/usr/include/c++/4.6/bits/stl_vector.h:180:11: error: previous declaration of ‘template<class _Tp, class _Alloc> class std::vector’
../src/vector_tile.pb.h:180:55: error: ‘namespace mapnik::vector { }’ redeclared as different kind of symbol
/usr/include/c++/4.6/bits/stl_vector.h:180:11: error: previous declaration of ‘template<class _Tp, class _Alloc> class std::vector’
../src/vector_tile.pb.h:180: confused by earlier errors, bailing out

@springmeyer
Copy link
Contributor

Yes, this is needing fixed / known issue. Use clang++ instead of g++ for now to avoid the problem.

@veejaykrishnan
Copy link
Author

Now i am getting the following error when using clang++

In file included from vector_tile.cpp:13:
../src/vector_tile_projection.hpp:12:30: error: redefinition of 'vector' as different kind of symbol
namespace mapnik { namespace vector {
^
/usr/local/include/mapnik/stroke.hpp:37:12: note: previous definition is here
using std::vector;
^
In file included from vector_tile.cpp:20:
../src/vector_tile_processor.hpp:53:30: error: redefinition of 'vector' as different kind of symbol
namespace mapnik { namespace vector {
^
/usr/local/include/mapnik/stroke.hpp:37:12: note: previous definition is here
using std::vector;
^
In file included from vector_tile.cpp:20:
../src/vector_tile_processor.hpp:144:32: error: no matching constructor for initialization of 'mapnik::projection'
mapnik::projection proj1(lay.srs(),true);
^ ~~~~~~~~~~~~~~
/usr/local/include/mapnik/projection.hpp:56:14: note: candidate constructor not viable: allows at most single argument 'params', but 2
arguments were provided
explicit projection(std::string const& params = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");
^
/usr/local/include/mapnik/projection.hpp:57:5: note: candidate constructor not viable: requires single argument 'rhs', but 2 arguments were
provided
projection(projection const& rhs);
^
In file included from vector_tile.cpp:20:
../src/vector_tile_processor.hpp:259:32: error: no matching constructor for initialization of 'mapnik::raster'
raster target(target_ext, raster_width, raster_height);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/mapnik/raster.hpp:35:5: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
raster(box2d const& ext,image_data_32 const& data)
^
/usr/local/include/mapnik/raster.hpp:31:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3
were provided
struct raster
^
In file included from vector_tile.cpp:20:
../src/vector_tile_processor.hpp:261:38: error: no member named 'premultiplied_alpha_' in 'mapnik::raster'
if (!source->premultiplied_alpha_)
~~~~~~ ^
In file included from vector_tile.cpp:21:
In file included from ../src/vector_tile_backend_pbf.hpp:10:
/usr/include/mapnik/value_types.hpp:48:8: error: redefinition of 'value_null'
struct value_null
^
/usr/local/include/mapnik/value.hpp:71:8: note: previous definition is here
struct value_null
^
In file included from vector_tile.cpp:21:
In file included from ../src/vector_tile_backend_pbf.hpp:13:
../src/vector_tile.pb.h:28:11: error: redefinition of 'vector' as different kind of symbol
namespace vector {
^
/usr/local/include/mapnik/stroke.hpp:37:12: note: previous definition is here
using std::vector;
^
In file included from vector_tile.cpp:21:
In file included from ../src/vector_tile_backend_pbf.hpp:13:
../src/vector_tile.pb.h:255:20: error: expected a class or namespace
inline ::mapnik::vector::tile_GeomType type() const;
~~~~~~~~~~^
../src/vector_tile.pb.h:255:20: error: reference to 'vector' is ambiguous
inline ::mapnik::vector::tile_GeomType type() const;
~~~~~~~~~~^
/usr/local/include/mapnik/stroke.hpp:37:12: note: candidate found by name lookup is 'mapnik::vector'
using std::vector;
^
../src/vector_tile.pb.h:28:11: note: candidate found by name lookup is 'mapnik::vector'
namespace vector {
^
../src/vector_tile.pb.h:256:34: error: expected a class or namespace
inline void set_type(::mapnik::vector::tile_GeomType value);
~~~~~~~~~~^
../src/vector_tile.pb.h:256:34: error: reference to 'vector' is ambiguous
inline void set_type(::mapnik::vector::tile_GeomType value);
~~~~~~~~~~^
/usr/local/include/mapnik/stroke.hpp:37:12: note: candidate found by name lookup is 'mapnik::vector'
using std::vector;
^
../src/vector_tile.pb.h:28:11: note: candidate found by name lookup is 'mapnik::vector'
namespace vector {
^
../src/vector_tile.pb.h:375:26: error: expected a class or namespace
inline const ::mapnik::vector::tile_feature& features(int index) const;
~~~~~~~~~~^
../src/vector_tile.pb.h:375:26: error: reference to 'vector' is ambiguous
inline const ::mapnik::vector::tile_feature& features(int index) const;
~~~~~~~~~~^
/usr/local/include/mapnik/stroke.hpp:37:12: note: candidate found by name lookup is 'mapnik::vector'
using std::vector;
^
../src/vector_tile.pb.h:28:11: note: candidate found by name lookup is 'mapnik::vector'
namespace vector {
^
../src/vector_tile.pb.h:376:20: error: expected a class or namespace
inline ::mapnik::vector::tile_feature* mutable_features(int index);
~~~~~~~~~~^
../src/vector_tile.pb.h:376:20: error: reference to 'vector' is ambiguous
inline ::mapnik::vector::tile_feature* mutable_features(int index);
~~~~~~~~~~^
/usr/local/include/mapnik/stroke.hpp:37:12: note: candidate found by name lookup is 'mapnik::vector'
using std::vector;
^
../src/vector_tile.pb.h:28:11: note: candidate found by name lookup is 'mapnik::vector'
namespace vector {
^
../src/vector_tile.pb.h:377:20: error: expected a class or namespace
inline ::mapnik::vector::tile_feature* add_features();
~~~~~~~~~~^
../src/vector_tile.pb.h:377:20: error: reference to 'vector' is ambiguous
inline ::mapnik::vector::tile_feature* add_features();
~~~~~~~~~~^
/usr/local/include/mapnik/stroke.hpp:37:12: note: candidate found by name lookup is 'mapnik::vector'
using std::vector;
^
../src/vector_tile.pb.h:28:11: note: candidate found by name lookup is 'mapnik::vector'
namespace vector {
^
../src/vector_tile.pb.h:378:64: error: expected a class or namespace
inline const ::google::protobuf::RepeatedPtrField< ::mapnik::vector::tile_feature >&
~~~~~~~~~~^
../src/vector_tile.pb.h:378:64: error: reference to 'vector' is ambiguous
inline const ::google::protobuf::RepeatedPtrField< ::mapnik::vector::tile_feature >&
~~~~~~~~~~^
/usr/local/include/mapnik/stroke.hpp:37:12: note: candidate found by name lookup is 'mapnik::vector'
using std::vector;
^
../src/vector_tile.pb.h:28:11: note: candidate found by name lookup is 'mapnik::vector'
namespace vector {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

@springmeyer
Copy link
Contributor

What Mapnik version are you using? If v2.2.0, then try with the 2.3.x branch: https://github.com/mapnik/mapnik/tree/2.3.x

@veejaykrishnan
Copy link
Author

Springmeyer,

              I have installed mapnik2.3.x version. Still i am getting the below error using compiler clang++.

undefined reference to google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)' vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector12tile_featureEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector12tile_featureEE11TypeHandlerEEERKNT_4TypeEi]+0x69): undefined reference togoogle::protobuf::internal::LogMessage::operator<<(char const_)'
vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector12tile_featureEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector12tile_featureEE11TypeHandlerEEERKNT_4TypeEi]+0x7f): undefined reference to google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector12tile_featureEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector12tile_featureEE11TypeHandlerEEERKNT_4TypeEi]+0xa1): undefined reference togoogle::protobuf::internal::LogMessage::~LogMessage()'
vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector12tile_featureEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector12tile_featureEE11TypeHandlerEEERKNT_4TypeEi]+0xdc): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()' /tmp/vector_tile-f4acaf.o: In functiongoogle::protobuf::RepeatedPtrFieldmapnik::vector::tile_layer::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Getgoogle::protobuf::RepeatedPtrFieldmapnik::vector::tile_layer::TypeHandler(int) const':
vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi]+0x55): undefined reference to google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const_, int)' vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi]+0x69): undefined reference to google::protobuf::internal::LogMessage::operator<<(char const*)'
vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi]+0x7f): undefined reference togoogle::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)' vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi]+0xa1): undefined reference to google::protobuf::internal::LogMessage::~LogMessage()'
vector_tile.cpp:(.text._ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi[_ZNK6google8protobuf8internal20RepeatedPtrFieldBase3GetINS0_16RepeatedPtrFieldIN6mapnik6vector10tile_layerEE11TypeHandlerEEERKNT_4TypeEi]+0xdc): undefined reference to`google::protobuf::internal::LogMessage::~LogMessage()'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@springmeyer
Copy link
Contributor

looks like your problem is that -lprotobuf-lite is not working and protobuf is not getting linked. Slightly different than #58 but likely related, lets track at #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants