Build mapnik viewer on msvc

82 views Asked by At

I've installed mapnik via vcpkg: vcpkg install mapnik Also I've downloaded sources of mapnik and trying to build mapnik's demo c++ & Qt project - viewer - https://github.com/mapnik/mapnik/tree/master/demo/viewer

Also I have Visual Studio 2019 & Qt 5.12.4 for msvc2017.

I import viewer.pro file into Visual Studio, change Solution's Qt Version from x64 to x86, change compiler from 2019 to 2017 (v141) and get the build errors:

1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::_Tree_iterator<class std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> > > > __thiscall std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct mapnik::value_holder,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> >,0> >::begin(void)" (__imp_?begin@?$_Tree@V?$_Tmap_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uvalue_holder@mapnik@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uvalue_holder@mapnik@@@std@@@2@$0A@@std@@@std@@QAE?AV?$_Tree_iterator@V?$_Tree_val@U?$_Tree_simple_types@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uvalue_holder@mapnik@@@std@@@std@@@std@@@2@XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog@@QAE@AAVlayer@mapnik@@PAVQWidget@@@Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::_Tree_iterator<class std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> > > > __thiscall std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct mapnik::value_holder,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> >,0> >::end(void)" (__imp_?end@?$_Tree@V?$_Tmap_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uvalue_holder@mapnik@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uvalue_holder@mapnik@@@std@@@2@$0A@@std@@@std@@QAE?AV?$_Tree_iterator@V?$_Tree_val@U?$_Tree_simple_types@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uvalue_holder@mapnik@@@std@@@std@@@std@@@2@XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog@@QAE@AAVlayer@mapnik@@PAVQWidget@@@Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct mapnik::value_holder,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> >,0> >::size(void)const " (__imp_?size@?$_Tree@V?$_Tmap_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uvalue_holder@mapnik@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uvalue_holder@mapnik@@@std@@@2@$0A@@std@@@std@@QBEIXZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog@@QAE@AAVlayer@mapnik@@PAVQWidget@@@Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::parameters::~parameters(void)" (__imp_??1parameters@mapnik@@QAE@XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog@@QAE@AAVlayer@mapnik@@PAVQWidget@@@Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::parameters::parameters(class mapnik::parameters const &)" (__imp_??0parameters@mapnik@@QAE@ABV01@@Z) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog@@QAE@AAVlayer@mapnik@@PAVQWidget@@@Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::value(void)" (__imp_??0value@value_adl_barrier@mapnik@@QAE@XZ) referenced in function "void __cdecl mapnik::`dynamic initializer for 'default_feature_value''(void)" (??__Edefault_feature_value@mapnik@@YAXXZ)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::value(void)" (__imp_??0value@value_adl_barrier@mapnik@@QAE@XZ)
1>styles_model.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::value(void)" (__imp_??0value@value_adl_barrier@mapnik@@QAE@XZ)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::~value(void)" (__imp_??1value@value_adl_barrier@mapnik@@QAE@XZ) referenced in function "void __cdecl mapnik::`dynamic atexit destructor for 'default_feature_value''(void)" (??__Fdefault_feature_value@mapnik@@YAXXZ)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::~value(void)" (__imp_??1value@value_adl_barrier@mapnik@@QAE@XZ)
1>styles_model.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::~value(void)" (__imp_??1value@value_adl_barrier@mapnik@@QAE@XZ)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class mapnik::parameters & __thiscall mapnik::datasource::params(void)" (__imp_?params@datasource@mapnik@@QAEAAVparameters@2@XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog@@QAE@AAVlayer@mapnik@@PAVQWidget@@@Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall mapnik::layer::name(void)const " (__imp_?name@layer@mapnik@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog@@QAE@AAVlayer@mapnik@@PAVQWidget@@@Z)
1>layerlistmodel.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall mapnik::layer::name(void)const " (__imp_?name@layer@mapnik@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall mapnik::layer::name(void)const " (__imp_?name@layer@mapnik@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class mapnik::datasource> __thiscall mapnik::layer::datasource(void)const " (__imp_?datasource@layer@mapnik@@QBE?AV?$shared_ptr@Vdatasource@mapnik@@@std@@XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog@@QAE@AAVlayer@mapnik@@PAVQWidget@@@Z)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::vector<class mapnik::layer,class std::allocator<class mapnik::layer> > & __thiscall mapnik::Map::layers(void)" (__imp_?layers@Map@mapnik@@QAEAAV?$vector@Vlayer@mapnik@@V?$allocator@Vlayer@mapnik@@@std@@@std@@XZ) referenced in function "public: virtual int __thiscall LayerListModel::rowCount(class QModelIndex const &)const " (?rowCount@LayerListModel@@UBEHABVQModelIndex@@@Z)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::vector<class mapnik::layer,class std::allocator<class mapnik::layer> > & __thiscall mapnik::Map::layers(void)" (__imp_?layers@Map@mapnik@@QAEAAV?$vector@Vlayer@mapnik@@V?$allocator@Vlayer@mapnik@@@std@@@std@@XZ)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: double __thiscall mapnik::Map::scale(void)const " (__imp_?scale@Map@mapnik@@QBENXZ) referenced in function "public: virtual class QVariant __thiscall LayerListModel::data(class QModelIndex const &,int)const " (?data@LayerListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: double __thiscall mapnik::Map::scale(void)const " (__imp_?scale@Map@mapnik@@QBENXZ)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall mapnik::layer::set_active(bool)" (__imp_?set_active@layer@mapnik@@QAEX_N@Z) referenced in function "public: virtual bool __thiscall LayerListModel::setData(class QModelIndex const &,class QVariant const &,int)" (?setData@LayerListModel@@UAE_NABVQModelIndex@@ABVQVariant@@H@Z)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall mapnik::layer::active(void)const " (__imp_?active@layer@mapnik@@QBE_NXZ) referenced in function "public: virtual class QVariant __thiscall LayerListModel::data(class QModelIndex const &,int)const " (?data@LayerListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall mapnik::layer::visible(double)const " (__imp_?visible@layer@mapnik@@QBE_NN@Z) referenced in function "public: virtual class QVariant __thiscall LayerListModel::data(class QModelIndex const &,int)const " (?data@LayerListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall mapnik::layer::visible(double)const " (__imp_?visible@layer@mapnik@@QBE_NN@Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class mapnik::datasource_cache & __cdecl mapnik::singleton<class mapnik::datasource_cache,class mapnik::CreateStatic>::instance(void)" (__imp_?instance@?$singleton@Vdatasource_cache@mapnik@@VCreateStatic@2@@mapnik@@SAAAVdatasource_cache@2@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall mapnik::datasource_cache::register_datasources(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (__imp_?register_datasources@datasource_cache@mapnik@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl mapnik::freetype_engine::register_fonts(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (__imp_?register_fonts@freetype_engine@mapnik@@SA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl mapnik::setup(void)" (__imp_?setup@mapnik@@YAXXZ) referenced in function 

_mainmapnik::binary_function_call> > > const & __thiscall mapnik::rule::get_filter(void)const " (__imp_?get_filter@rule@mapnik@@QBEABV?$shared_ptr@V?$variant@Uvalue_null@mapnik@@_NHNVUnicodeString@icu_72@@Uattribute@2@Uglobal_attribute@2@Ugeometry_type_attribute@2@V?$recursive_wrapper@U?$unary_node@Unegate@tags@mapnik@@@mapnik@@@util@mapbox@@V?$recursive_wrapper@U?$binary_node@Uplus@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Uminus@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Umult@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Udiv@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Umod@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Uless@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Uless_equal@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Ugreater@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Ugreater_equal@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Uequal_to@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Unot_equal_to@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$unary_node@Ulogical_not@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Ulogical_and@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@U?$binary_node@Ulogical_or@tags@mapnik@@@mapnik@@@9mapbox@@V?$recursive_wrapper@Uregex_match_node@mapnik@@@9mapbox@@V?$recursive_wrapper@Uregex_replace_node@mapnik@@@9mapbox@@V?$recursive_wrapper@Uunary_function_call@mapnik@@@9mapbox@@V?$recursive_wrapper@Ubinary_function_call@mapnik@@@9mapbox@@@util@mapbox@@@std@@XZ) referenced in function "public: class QString __thiscall rule_node::name(void)const " (?name@rule_node@@QBE?AVQString@@XZ)
1>styles_model.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::vector<class mapnik::rule,class std::allocator<class mapnik::rule> > const & __thiscall mapnik::feature_type_style::get_rules(void)const " (__imp_?get_rules@feature_type_style@mapnik@@QBEABV?$vector@Vrule@mapnik@@V?$allocator@Vrule@mapnik@@@std@@@std@@XZ) referenced in function "public: __thiscall StyleModel::StyleModel(class std::shared_ptr<class mapnik::Map>,class QObject *)" (??0StyleModel@@QAE@V?$shared_ptr@VMap@mapnik@@@std@@PAVQObject@@@Z)
1>debug\\viewer.exe : fatal error LNK1120: 84 unresolved externals
1>Done building project "viewer.vcxproj" -- FAILED.

How to build the project on msvc and Qt 5?

0

There are 0 answers