artemp/mapnik — Issue #719: Runnin mapnik application under Windows XP
Author: artemp
Created: 2011-10-11 16:33:32+00:00
State: open
Labels: Core_Library

Hi all, I'm trying to run, under Windows XP, a C++ application containing calls to Mapnik's (release 0.7.1) procedure, but always getting error messages.
Some details: I have created a Qt application (Qt library release 4.2.3) with Microsoft Visual C++ 2005, it just contains a form with a button.
In the onClick button event, I just create a Map object by calling Map(800,600), as shown in the following:

using namespace mapnik;

std::string mapnik_dir("E:/mapnik-0.7.1/lib/mapnik");

datasource_cache::instance()->register_datasources(mapnik_dir + "/input/");

freetype_engine::register_font(mapnik_dir + "/fonts/DejaVuSans.ttf");

Map m(800,600);

After linking all the necessary static libraries, and set the environement variable to use Mapnik's API, I can correctly compile the application.

Running in debug, the statement 'freetype_engine::register_font(mapnik_dir + "/fonts/DejaVuSans.ttf");' makes the application to crash with 'bad allocation' error.

Commenting the above statement (freetype_engine::register_font ...), the statement Map(800,600) makes the application to crash with an 'access violation' error.

Really don't know what I can do anymore.
I'm linking the following libraries to my Visual C++ project:

1) Mapnik 0.7.1 (mapnik.lib)

2) freetype-2.4.4

3) boost_1.46.0

4) Unicode icu (icu4c-4_6-Win32-msvc10)

I've included in the project the attached ltdl.h header file.

Any help would be very appreciated.
Thanks in advance.

Massimo