Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with running server #2

Open
hjanetzek opened this issue Dec 6, 2012 · 6 comments
Open

problem with running server #2

hjanetzek opened this issue Dec 6, 2012 · 6 comments

Comments

@hjanetzek
Copy link

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
Copy link
Author

@springmeyer
Copy link
Collaborator

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 pushed a commit that referenced this issue Dec 6, 2012
@springmeyer
Copy link
Collaborator

Ah, I see the problem. try:

export LD_PRELOAD=./node_modules/mapnik/lib/_mapnik.node

@hjanetzek
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants