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

Tests fail to build #58

Closed
tomhughes opened this issue Sep 4, 2014 · 5 comments
Closed

Tests fail to build #58

tomhughes opened this issue Sep 4, 2014 · 5 comments

Comments

@tomhughes
Copy link
Contributor

The tests are failing to build in the 0.5.5 code:

In file included from ./src/vector_tile.pb.h:25:0,
                 from ./src/vector_tile_backend_pbf.hpp:12,
                 from test/vector_tile.cpp:21:
/usr/include/google/protobuf/extension_set.h:183:21: error: reference to 'vector' is ambiguous
                     vector<const FieldDescriptor*>* output) const;
                     ^
In file included from /usr/include/c++/4.8.3/vector:64:0,
                 from test/catch.hpp:355,
                 from test/vector_tile.cpp:3:
/usr/include/c++/4.8.3/bits/stl_vector.h:210:11: note: candidates are: template<class _Tp, class _Alloc> class std::vector
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^
In file included from test/vector_tile.cpp:13:0:
./src/vector_tile_projection.hpp:12:37: note:                 namespace mapnik::vector { }
 namespace mapnik { namespace vector {
                                     ^
In file included from ./src/vector_tile.pb.h:25:0,
                 from ./src/vector_tile_backend_pbf.hpp:12,
                 from test/vector_tile.cpp:21:
/usr/include/google/protobuf/extension_set.h:183:21: error: 'vector' has not been declared
                     vector<const FieldDescriptor*>* output) const;
                     ^
/usr/include/google/protobuf/extension_set.h:183:27: error: expected ',' or '...' before '<' token
                     vector<const FieldDescriptor*>* output) const;
                           ^
In file included from ./src/vector_tile.pb.h:25:0,
                 from ./src/vector_tile_backend_pbf.hpp:12,
                 from test/raster_tile.cpp:12:
/usr/include/google/protobuf/extension_set.h:183:21: error: reference to 'vector' is ambiguous
                     vector<const FieldDescriptor*>* output) const;
                     ^
In file included from /usr/include/c++/4.8.3/vector:64:0,
                 from test/catch.hpp:355,
                 from test/raster_tile.cpp:3:
/usr/include/c++/4.8.3/bits/stl_vector.h:210:11: note: candidates are: template<class _Tp, class _Alloc> class std::vector
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^
In file included from test/raster_tile.cpp:8:0:
./src/vector_tile_projection.hpp:12:37: note:                 namespace mapnik::vector { }
 namespace mapnik { namespace vector {
                                     ^
In file included from ./src/vector_tile.pb.h:25:0,
                 from ./src/vector_tile_backend_pbf.hpp:12,
                 from test/raster_tile.cpp:12:
/usr/include/google/protobuf/extension_set.h:183:21: error: 'vector' has not been declared
                     vector<const FieldDescriptor*>* output) const;
                     ^
/usr/include/google/protobuf/extension_set.h:183:27: error: expected ',' or '...' before '<' token
                     vector<const FieldDescriptor*>* output) const;
                           ^

Compiler is gcc 4.8.3 and mapnik is 2.2.

@StevenLooman
Copy link
Contributor

From #63, try using clang++. On Ubuntu you can install clang by running:

sudo apt-get install clang

Then run:

make clean
CXX=clang++ make test

Works for me, using de1d542, running Ubuntu 14.04.

Another fix might (untested!) be editing file /usr/include/google/protobuf/extension_set.h. At line 183, change this:

  void AppendToList(const Descriptor* containing_type,
                    const DescriptorPool* pool,
                    vector<const FieldDescriptor*>* output) const;

to this:

  void AppendToList(const Descriptor* containing_type,
                    const DescriptorPool* pool,
                    std::vector<const FieldDescriptor*>* output) const;

(note the std:: before vector)

Then run the tests as you normally would:

make test

@springmeyer
Copy link
Contributor

planning on working around this by updating to the latest vector tile spec protobuf which includes

Started here: 1532ccc

@springmeyer
Copy link
Contributor

fixed by #66

@tomhughes
Copy link
Contributor Author

I can confirm that the 0.6.0 release appears to fix this.

@springmeyer
Copy link
Contributor

noting that the cause of the clashing vector namespace may eventually get fixed upstream: protocolbuffers/protobuf#72

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

3 participants