I'm trying to build a lzham NodeJS binding, but I keep getting symbol lookup error: [...] undefined symbol: [...]
errors whenever I try to call a function from lzham.
I've included lzham like so :
#define LZHAM_DEFINE_ZLIB_API
#include "lzham_static_lib.h"
And my binding.gyp
file looks like this :
{
"targets": [
{
"target_name": "lzham",
"sources": [
"lzham.cc"
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
"lzham/include",
"lzham/lzhamdecomp",
"lzham/lzhamcomp",
],
},
]
}
I'm compiling on Linux.
var lzham = require('./build/Release/lzham.node'),
buffer = require('fs').readFileSync('compressed');
lzham.decompress(buffer);
This code calls a function defined in C++ that in turn calls lzham_z_inflateInit2
, producing this error:
node: symbol lookup error: /node-lzham/build/Release/lzham.node: undefined symbol: lzham_z_inflateInit2