capnproto/node-capnp

Node: symbol lookup error when requiring .capnp file

nilya opened this issue · 2 comments

Node.js exits with error on .capnp file require or import.

node: symbol lookup error: /home/dev/capnp/node-capnp/bin/linux-x64-v8-3.14/capnp.node: undefined symbol: _ZNK5capnp1_13PointerReader7getListENS_11ElementSizeEPKNS_4wordE

Example file is:

var capnp = require("./node-capnp");

var person = require('./person.capnp');
//var foofoo = capnp.import(__dirname + "/person.capnp");

person.capnp is the example form http://kentonv.github.io/capnproto/language.html

Capnproto was built from git (commit c50dd6022c514763994910f3b9e4059f61698c23),
node-capnp is from git too (commit fad577c).
Ubuntu 14.04 64 bit,
node -v v0.10.33.

Tried capnproto-0.4.1 too, but npm install can't finish compilation.

Hi Ilya,

It sounds to me like your node-capnp was built using a different version of the Cap'n Proto library than it is finding at runtime. This can be tricky to manage when building from git, since the library ABI is constantly changing (C++ is like that) and we aren't bumping the soname with every commit (we only do that for releases).

Can you try rebuilding and re-installing everything from scratch? Make sure that the capnp.node file is really deleted otherwise it may not be rebuilt.

Hi Kenton,

You are right, problem was with 0.4.1 installed system wide.
CPATH=path_to_include LIBRARY_PATH=path_to_lib npm install node-capnp solved the problem.
Thank you.