1

I am trying to compile a c++ mapnik program with code in question being:

mapnik::grid my_grid(256, 256, "id");

and the command to compile being:

g++ grid_gen.cpp -std=c++11 -lmapnik -lcairo -lfreetype -lpng -licuuc -lz -ldl -Wall -o grid_gen

which ends up throwing this error:

grid_gen.cpp:(.text+0x744): undefined reference to `mapnik::hit_grid<mapnik::gray32s_t>::hit_grid(unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' collect2: error: ld returned 1 exit status

I am on Ubuntu 16.04.2 with g++ 5.4.0.

How do I compile this without throwing any error?

If you are curious, I am trying to generate utf8 grid for the map tiles from c++.

1 Answer 1

0

Searching through the mapnik code base, brought me to the file include/mapnik/value/types.hpp, which had this code:

#ifdef BIGINT
//using value_integer = boost::long_long_type;
//using value_integer = long long;
using value_integer = std::int64_t;
using value_integer_pixel = gray64s_t;
#else
//using value_integer = int;
using value_integer = std::int32_t;
using value_integer_pixel = gray32s_t;
#endif

I am on a 64 bit system. I have defined a constant BIGINT

#define BIGINT 1

in the script and code is compiling without errors now. Don't know if this is acceptable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.