Well, I said I would report back. Unfortunately, I wasn't successful.
I got all the prerequisites and compiled them.
These compile with little or no trouble in VS:
http://site.icu-project.org/download/46#ICU4C-Download
http://download.savannah.gnu.org/releases/freetype/
http://trac.osgeo.org/proj/
ftp://ftp.remotesensing.org/pub/libtiff
http://www.libpng.org/pub/png/libpng.html
http://zlib.net/
http://www.ijg.org/
ftp://xmlsoft.org/libxml2/
But this one is a show stopper:
http://www.gnu.org/software/libtool/
What I ended up doing for libtool was compiling it in MinGW. And
converting the .a file to a .lib. It's supposed to work with Microsofts
Visual C++, but this is one place where I feel things may have gone wrong.
I made some edits to the Mapnik code to get it to work with the latest
Boost files. And this is the second place where I may have messed things
up. I didn't use the Boost header files that came with the Mapnik source
at all. I'm kind of confused why Boost header files are distributed with
Mapnik, but there is probably a good reason. So that's another place
things may have gone wrong.
Anyway, I got the whole thing to compile, link, and run without
crashing... but it didn't work.
It throws and exception at line 190:
lyr.set_datasource(datasource_cache::instance()->create(p));
saying that is doesn't have a plugin for type "shape." Which probably
means it failed to load the shape.input file earlier. Which could be a
problem with libtool, or the shape.input file, or even a messed up Boost.
Anyway, I don't need this to run in Visual Studios. All I need are some
tiles to test something. And to that end this morning I learned enough
Python and Mapnik to generate a good enough tile set for my purposes. I
should have done that a week ago, but I'm stubborn. And since I'm
stubborn I'll probably continue to tinker with it for a while, but I'm
doubtful that I'll make much progress.
On 4/6/2011 10:47 AM, William Johnston wrote:
LOL I didn't know it was fashionable to dislike VS. I just know that
every time I use it it's like getting kicked in the head.
Anyway, I'm pretty sure the Boost files are the ones I need. I'll
recompile all the others and let you know how it goes.
On 4/5/2011 2:48 PM, Roel Vanhout wrote:
Are you sure these libraries were all compiled with VS10? I'm quite
sure they're not. For example the freetype page mentions the msvc 6
runtime dll's. There is no guarantee in C++ that object files from
different compilers will work together, so mixing vs6 and vs8 object
files is almost sure to not work.
So, compile everything from source, using my instructions on the wiki
(I posted the link yesterday or so - or maybe it was on -devel). It's
virtually impossible to get C++ programs to work from binary
libraries. Don't bother trying until you know about all the details
and how the compilers work.
When you compile all these things from source, make sure to use the
same settings for each project: runtime libary, usage of SECURE_CRT,
what version of the crt to use, etc. Again, I don't recommend trying
unless you already know how to work with VS.
Also, this has nothing to do with VS. It's just how C++ works. I know
it's fashionable to dislike VS, but the fact of the matter is that
it's universal that things only work when one knows how to work with
them.
cheers,
roel
On Tue, Apr 5, 2011 at 7:18 PM, William Johnston<[email protected]>
wrote:
Well, I didn't compile any of the libraries. I got precompiled
versions for
Windows:
Mapnik 0.7.1:
http://prdownload.berlios.de/mapnik/mapnik-0.7.1-win32-py25_26.zip
Boost 1.46.1: http://www.boostpro.com/download/
ICU4C 4.6.1: http://site.icu-project.org/download
GNU Libtool 1.5.26:
http://gnuwin32.sourceforge.net/packages/libtool.htm
Freetype 2.3.6: http://gnuwin32.sourceforge.net/packages/freetype.htm
In Visual Studios I started with an empty project. I changed only the
project settings having to do with finding the right libraries and
include
files.
Here are some of the project settings that might be relevant:
Character Set ------- Use Multi-Byte Character Set
Runtime library ----- Multi-threaded DLL
Changing the "Character set" to "Use Unicode Character Set" didn't
change
anything.
Changing the "Runtime library" to "Multi-threaded Debug DLL" caused the
program to crash at a later point:
m.insert_style("provinces",provpoly_style);
I fiddled with a bunch of other setting, but nothing worked.
I would like to take this moment to say that I have always hated Visual
Studios.
On 4/5/2011 4:55 AM, Roel Vanhout wrote:
Looks like an issue between ANSI and Unicode strings (in the MSVC
sense, i.e. single- vs multibyte strings).
How did you compile things? Build everything (including boost) from
source? What VS project files do you use?
On Tue, Apr 5, 2011 at 2:51 AM, William Johnston<[email protected]>
wrote:
I'm using VS 2010 and Mapnik 0.7.1 and compiling to 32 bits.
When I run rundemo.exe I get this:
Z:\SoftwareDevelopment\c++\Mapnik\Release>a
Z:\SoftwareDevelopment\c++\Mapnik\ma
pnik-0.7.1\lib\mapnik
running demo ...
looking for 'shape.input' plugin in...
Z:\SoftwareDevelopment\c++\Mapnik\mapnik
-0.7.1\lib\mapnik/input/
looking for DejaVuSans font in...
Z:\SoftwareDevelopment\c++\Mapnik\mapnik-0.7.
1\lib\mapnik/fonts/DejaVuSans.ttf
### Configuration error: Failed to parse filter expression:
rundemo Z:\SoftwareDevelopment
Parsing aborted at 'r'
It's trying to parse the command line. If I change rundemo.exe to
a.exe
and
rerun it I get:
Z:\SoftwareDevelopment\c++\Mapnik\Release>a
Z:\SoftwareDevelopment\c++\Mapnik\ma
pnik-0.7.1\lib\mapnik
running demo ...
looking for 'shape.input' plugin in...
Z:\SoftwareDevelopment\c++\Mapnik\mapnik
-0.7.1\lib\mapnik/input/
looking for DejaVuSans font in...
Z:\SoftwareDevelopment\c++\Mapnik\mapnik-0.7.
1\lib\mapnik/fonts/DejaVuSans.ttf
here### Configuration error: Failed to parse filter expression:
a Z:\SoftwareDevelopment\c++\M
Parsing aborted at 'a'
The error is caused by this line:
provpoly_rule_on.set_filter("[NAME_EN] = 'Ontario'");
My understanding is that it is supposed to be parsing "[NAME_EN] =
'Ontario'" rather than the run command.
If I change the line to be these two lines:
std::string test("[NAME_EN] = 'Ontario'");
provpoly_rule_on.set_filter(create_filter(test));
I get:
Z:\SoftwareDevelopment\c++\Mapnik\Release>Mapnik
C:\mapnik-0.7.1\lib\mapnik
running demo ...
looking for 'shape.input' plugin in...
Z:\SoftwareDevelopment\c++\Mapnik\mapnik
-0.7.1\lib\mapnik/input/
looking for DejaVuSans font in...
C:\mapnik-0.7.1\lib\mapnik/fonts/DejaVuSans.t
tf
### Configuration error: Failed to parse filter expression:
،n
Even weirder.
The peer line in rundemo.py works fine.
This error make no logical sense. My current thinking is that
there is
something wrong with mapnik.dll
or mapnik.lib.
Does anyone have any experience with this?
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users
_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users