node-judy icon indicating copy to clipboard operation
node-judy copied to clipboard

build error

Open ghominejad opened this issue 10 years ago • 1 comments

Hello, I'm using node via nvm and can't build judy then i tried to install via npm but the same error : error: ‘free’ was not declared in this scope

gyp ERR! node -v v0.10.32 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not ok

------- Details ------

[email protected] install /data1/Projects/noon/NoonImporter/node_modules/judy node-gyp rebuild

make: Entering directory `/data1/Projects/noon/NoonImporter/node_modules/judy/build' CXX(target) Release/obj.target/judy/src/judy.o In file included from ../src/judy.cc:31:0: ../src/judy64nb.h:6:0: warning: "_LARGEFILE_SOURCE" redefined [enabled by default] #define _LARGEFILE_SOURCE ^ In file included from /usr/include/stdint.h:25:0, from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h:9, from /home/hassan/.node-gyp/0.10.32/deps/uv/include/uv.h:56, from /home/hassan/.node-gyp/0.10.32/src/node.h:61, from ../src/judy.cc:25: /usr/include/features.h:272:0: note: this is the location of the previous definition

define _LARGEFILE_SOURCE 1

^ In file included from ../src/judy.cc:31:0: ../src/judy64nb.h:7:0: warning: "__USE_FILE_OFFSET64" redefined [enabled by default] #define __USE_FILE_OFFSET64 ^ In file included from /usr/include/stdint.h:25:0, from /usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h:9, from /home/hassan/.node-gyp/0.10.32/deps/uv/include/uv.h:56, from /home/hassan/.node-gyp/0.10.32/src/node.h:61, from ../src/judy.cc:25: /usr/include/features.h:301:0: note: this is the location of the previous definition

define __USE_FILE_OFFSET64 1

^ ../src/judy.cc: In destructor ‘virtual JudyNode::~JudyNode()’: ../src/judy.cc:54:28: error: ‘free’ was not declared in this scope free((void ) cell); ^ ../src/judy.cc: In function ‘int jg_set(void, uchar, uchar*, long unsigned int, int)’: ../src/judy.cc:77:36: error: ‘free’ was not declared in this scope free((void *) data->ptr); ^ ../src/judy.cc:79:27: error: ‘free’ was not declared in this scope free((void *) data); ^ ../src/judy.cc:82:74: error: ‘malloc’ was not declared in this scope struct store data = (struct store ) malloc(sizeof(struct store)); ^ ../src/judy.cc: In function ‘void jg_delete(void, uchar)’: ../src/judy.cc:122:40: error: ‘free’ was not declared in this scope free((void *) data->ptr); ^ ../src/judy.cc:124:31: error: ‘free’ was not declared in this scope free((void *) data); ^ make: *** [Release/obj.target/judy/src/judy.o] Error 1 make: Leaving directory/data1/Projects/noon/NoonImporter/node_modules/judy/build' gyp ERR! build error gyp ERR! stack Error: make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/nvm/v0.10.32/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12) gyp ERR! System Linux 3.11.0-26-generic gyp ERR! command "node" "/usr/local/nvm/v0.10.32/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /data1/Projects/noon/NoonImporter/node_modules/judy gyp ERR! node -v v0.10.32 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is most likely a problem with the judy package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls judy npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.11.0-26-generic npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "judy" npm ERR! cwd /data1/Projects/noon/NoonImporter npm ERR! node -v v0.10.32 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! not ok code 0

Regards

ghominejad avatar Oct 12 '14 21:10 ghominejad

Finally i have compiled it by including 'stdlib.h' in 'src/judy.cc'. But i've encountered new error when instantiation: var judy = require('judy').Judy; var myJudy = new judy(); The error : ../node_modules/judy/build/Release/judy.node: undefined symbol: _Z9judy_openjj

ghominejad avatar Oct 12 '14 22:10 ghominejad