I finally managed to compile mapnik viewer under ubuntu 9.10 but I
can't get it to run properly.
I used the ubuntu instructions at
http://trac.mapnik.org/wiki/UbuntuInstallation (0.7 branch from
source) and then followed the viewer instructions at
http://trac.mapnik.org/wiki/MapnikViewer.
The following build parameters for viewer.pro *seem* to work (viewer compiles):
INCLUDEPATH += /usr/local/include/mapnik
INCLUDEPATH += /usr/include/
INCLUDEPATH += /usr/include/X11
INCLUDEPATH += /usr/include/freetype2
INCLUDEPATH += .
QMAKE_CXXFLAGS +=' -DDARWIN -Wno-missing-field-initializers'
unix:LIBS = -L/usr/local/lib/mapnik -L/usr/lib/X11 -lmapnik
-lfreetype -L/usr/local/lib -licuuc
unix:LIBS += -lboost_system -lboost_filesystem -lboost_regex -L/usr/lib
I can start the GUI, but at file/open it crashes within
mapnik::load_map deep inside boost:
viewer: /usr/include/boost/variant/detail/visitation_impl.hpp:203:
typename Visitor::result_type
boost::detail::variant::visitation_impl(int, int, Visitor&, VPCV,
mpl_::true_, NBF, W*, S*) [with W =
boost::detail::variant::visitation_impl(int, int, Visitor&, VoidPtrCV,
mpl_::false_, NoBackupFlag, Which*,
< ... a _lot_ of details cut ... >
boost::detail::variant::void_>::has_fallback_type_]: Assertion `false' failed.
This code is deep inside boost variant (called by mapnik):
// should never be here at runtime:
BOOST_ASSERT(false);
The problem is obviously in mapnik::load_map but it's a wierd one - if
I modify main.cpp to contain only:
#include <mapnik/datasource_cache.hpp>
#include <mapnik/font_engine_freetype.hpp>
#include <mapnik/load_map.hpp>
int main( int argc, char **argv )
{
using mapnik::datasource_cache;
using mapnik::freetype_engine;
datasource_cache::instance()->register_datasources("/usr/local/lib/mapnik/input/");
freetype_engine::register_font("/usr/local/lib/mapnik/fonts/DejaVuSans.ttf");
boost::shared_ptr<mapnik::Map> map(new mapnik::Map(800,600));
mapnik::load_map(*map,"/home/gis/src/mapnik/tutorials/t2/world_styles.xml");
return 0;
}
This will still crash at mapnik::load_map. (world_styles.xml is xml
file from mapnik tutorial 2)
*But*, if I now modify the "viewer.pro" to compile *only* the modified
main.cpp (eg. I comment out all the HEADER and SOURCES except the
modified main.cpp) it will compile *and run* without error.
This makes me believe I've encountered some weird build/compiler bug
but I don't know where to go from here.
Any help is appreciated.
Hrvoje
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users