artemp / vector-tile-server

Vector tile server and rendering backend for Mapnik
60 stars 15 forks source link

problem with running server #2

Open hjanetzek opened 11 years ago

hjanetzek commented 11 years ago

do you have a guess what might cause this error? node-mapnik tests ran successfully. I've added 'ldflags': ['-zdefs'], to bindings.gyp target and it shows that vector_server.cpp:(.text+0xdf): undefined reference to `Map::constructor' (besides everything else also being undefined references). I'm building on ubuntu 10.04 with default nodejs 0.8 and mapnik master

jeff@city:/home/jeff/src/vector-tile-server% node ./server.js osm_vectors.xml 8000

module.js:485 process.dlopen(filename, module.exports); ^ Error: /home/jeff/src/vector-tile-server/build/Release/node_vector_server.node: undefined symbol: _ZN3Map11constructorE at Object.Module._extensions..node (module.js:485:11) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) at require (module.js:378:17) at Object. (/home/jeff/src/vector-tile-server/lib/vector_server.js:1:103) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12)

hjanetzek commented 11 years ago

http://city.informatik.uni-bremen.de/~jeff/build.log

springmeyer commented 11 years ago

This error is expected if var mapnik = require('mapnik'); does not come before require('./lib/vector_server'); in any script that uses the build/Release/node_vector_server.node module. Did you happen to edit the server.js at all? If not, then something must be messed up with the node-mapnik install. Perhaps you have a different node-mapnik on your NODE_PATH? (look in ~/node_modules/mapnik ?)

springmeyer commented 11 years ago

Ah, I see the problem. try:

export LD_PRELOAD=./node_modules/mapnik/lib/_mapnik.node
hjanetzek commented 11 years ago

indeed that solves it, could you tell me why? :) I was just about to write that this seems to be a really odd issue here, all linking were correct, the searched symbol existed in libmapnik.so, the right .so file was in the process, still got that error..

springmeyer commented 11 years ago

Yes, it is quite an odd/unique situation. The background is that the C++ bits of this node module are using the headers of another node C++ module (node-mapnik). This is not something I've done before. With a bit of research I should be able to figure out a better way to avoid this than LD_PRELOAD, but it should work in the meantime. Thanks for your understanding :)

hjanetzek commented 11 years ago

thank you, works like a charm now. btw polygons should be closed implicitly to save some bytes, this is now enabled automatically for the oscim(v2) database with my latest commit to VectorTileMap