sorry there was a filename typo in the last one in the g++ command, it is fixed below.
On Wed, July 8, 2009 4:13 pm, Lawrence David Jesper wrote: > Hello, > > > I've been working on setting up mapnik with java through jni so that I > can render the openstreetmap data. I've compiled mapnik using the scons > build system successfully, and have run the demo code with no issues. > > I then wrote a c++ program (1 main method) that renders a specific part > of england (I imported only the data for england due to system > restraints). The program runs and generates the image as expected. I've > attached the source code below (request_tiles.cpp). I then change the > method from a main method to a jni method (request_tiles_jni.cpp), wrote > the java method (MapnikNative.java), and generated the h file > (request_tiles_jni.h). I > compile the java using jdk1.6.0_14 (64 bit) then run the method. It breaks > with the following error when it tries to register the data sources: > > /home/ljesper/jdk1.6.0_14/bin/java: symbol lookup error: > /home/ljesper/bins/mapnik/lib64/mapnik/input/osm.input: undefined symbol: > _ZN7icu_4_213UnicodeStringC1ERKS0_ > > > > after ignoring these non-fatal errors: > > /home/ljesper/bins/mapnik/lib64/mapnik/input/raster.input: undefined > symbol: _ZN5boost6system19get_system_categoryEv > /home/ljesper/bins/mapnik/lib64/mapnik/input/postgis.input: undefined > symbol: _ZN5boost21thread_resource_errorD1Ev > /home/ljesper/bins/mapnik/lib64/mapnik/input/shape.input: undefined > symbol: _ZN5boost6system19get_system_categoryEv > > > > I compile my library with the following command: > g++ -o libmapnikjni.o -c -fPIC -DHAVE_LIBXML2 -ansi -Wall -pthread > -ftemplate-depth-100 -DLINUX -DBOOST_SPIRIT_THREADSAFE > -DMAPNIK_THREADSAFE > -O0 -fno-inline -g -DDEBUG -DMAPNIK_DEBUG -DNone -Iagg/include -Iinclude > -I. -I/home/ljesper/jdk1.6.0_14/include > -I/home/ljesper/jdk1.6.0_14/include/linux -I/usr/include -I/usr/include > -I/usr/local/include -I/usr/include/freetype2 -I/usr/include/libxml2 > request_tiles_jni.cpp > g++ -o libmapnikjni.so libmapnikjni.o -Lagg -Lsrc -L/usr/lib64 > -L/usr/local/lib64 -lboost_thread-gcc34-mt -lmapnik -shared -fPIC > > > > I ran ldd on libmapnikjni.so and it found all the dependencies in paths > included in the LD_LIBRARY_PATH variable and also printed as part of > java.library.path. The methods it prints as undefined are marked as such > when I run "nm libmapnikjni.so". The method it breaks on does not appear > anywhere in libmapnikjni.so; however, it does appear in libicuuc.so, an > included library. > > > My system is a 64bit CentOS 5. My compiler is g++ 3.4.6. I have also > followed the same procedure to the same effect on a Debian system with g++ > (Debian 4.3.3-10). I am running mapnik 0.6 on both with icu 42. I > attached my config.py file just in case that helps. > > Any suggestions or hunches would be greatly appreciated. > > > Thanks, > ldj _______________________________________________ > Mapnik-devel mailing list > [email protected] > https://lists.berlios.de/mailman/listinfo/mapnik-devel > > _______________________________________________ Mapnik-devel mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-devel
