radare2-bindings icon indicating copy to clipboard operation
radare2-bindings copied to clipboard

Cannot normally install nodejs bindings

Open dukebarman opened this issue 10 years ago • 2 comments

I try to use Nodejs bindings and have a problems with install. Make is normally finished but I see one error:

node-ffi # make
...
NOTICE >class Radare.RMagic
NOTICE >ns SDB
NOTICE >class SDB.Sdb
<stdin>: In function ‘main’:
<stdin>:30:15209: error: ‘R_ANAL_REFLINE_TYPE_STYLE’ undeclared (first use in this function)
<stdin>:30:15209: note: each undeclared identifier is reported only once for each function it appears in
<stdin>:30:17547: error: ‘R_DBG_REASON_NEW_PID’ undeclared (first use in this function)
<stdin>:30:17568: error: ‘R_DBG_REASON_NEW_TID’ undeclared (first use in this function)
<stdin>:30:17589: error: ‘R_DBG_REASON_NEW_LIB’ undeclared (first use in this function)
<stdin>:30:17610: error: ‘R_DBG_REASON_EXIT_PID’ undeclared (first use in this function)
<stdin>:30:17632: error: ‘R_DBG_REASON_EXIT_TID’ undeclared (first use in this function)
<stdin>:30:17654: error: ‘R_DBG_REASON_EXIT_LIB’ undeclared (first use in this function)
<stdin>:30:17676: error: ‘R_DBG_REASON_TRAP’ undeclared (first use in this function)
<stdin>:30:17694: error: ‘R_DBG_REASON_ILL’ undeclared (first use in this function)
<stdin>:30:17711: error: ‘R_DBG_REASON_SIGNAL’ undeclared (first use in this function)
<stdin>:30:17731: error: ‘R_DBG_REASON_FPU’ undeclared (first use in this function)
<stdin>:30:17748: error: ‘R_DBG_REASON_BP’ undeclared (first use in this function)
<stdin>:30:17764: error: ‘R_DBG_REASON_UNKNOWN’ undeclared (first use in this function)
ERROR gcc exited with status 256
... r_core.so
Build r_bin -lr_bin -lr_util -lr_db -lr_io 
valabind-cc node-ffi r_bin -NRadare -NSDB -x --vapidir=../vapi ../vapi/r_bin -I/usr/include/libr -lr_bin -lr_util -lr_db -lr_io
valabind --node-ffi -I /usr/include/libr -x -N SDB -N Radare --vapidir ../vapi -o r_bin.js -m r_bin ../vapi/r_bin
NOTICE Symbol defined VALABIND_NODEJS
NOTICE Adding dependency package glib-2.0
NOTICE Adding dependency package gobject-2.0
NOTICE Adding dependency package ../vapi/r_bin
NOTICE Adding dependency package r_util
NOTICE Adding dependency package r_io
NOTICE >ns Radare
...

After I try to start examples and see errors again: not load ffi & ref modules. And cannot npm install it from node-ffi folder: npm log https://dl.dropboxusercontent.com/u/10688770/npm-debug.log

But I could copy this modules from other folder and r_asm.js found it: r2_core_binding

dukebarman avatar Oct 15 '15 12:10 dukebarman

node.js ffi bindings are broken since long time ago...

Please try with r2pipe: https://www.npmjs.com/package/r2pipe https://github.com/radare/radare2-bindings/tree/master/r2pipe/nodejs

jpenalbae avatar Oct 16 '15 03:10 jpenalbae

the node-ffi generator of valabind got broken when the ffi node modules changed the API, the current generated code is wrong, i am priorizing the r2pipe api for simplicity.

But anyone intersted in maintaining the native apis is welcome

radare avatar Oct 16 '15 10:10 radare