radareorg / radare2-bindings

Bindings of the r2 api for Valabind and friends
GNU Lesser General Public License v3.0
132 stars 92 forks source link

r_bin.cxx:21:2: error: ‘Radare_RBinFile’ does not name a type #144

Closed blshkv closed 7 years ago

blshkv commented 7 years ago

Hi I'm getting the following error while compiling the latest 1.2.1. Any idea how to fix it?

Final report:
 - PREFIX = /usr
 - HAVE_SWIG = 1
 - HAVE_VALABIND = 1
 - HAVE_GIRCOMPILER = 1
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-libs/radare2-bindings-1.2.1/work/radare2-bindings-1.2.1 ...
make -j4 
make -C libr/lang/p
make[1]: Entering directory '/var/tmp/portage/dev-libs/radare2-bindings-1.2.1/work/radare2-bindings-1.2.1/libr/lang/p'
cc python.c -march=native -O2 -pipe -I/usr/include/libr  -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/include/texlua52 -I/usr/in
clude/texluajit  -I/usr/include/python2.7 -I/usr/include/python2.7  -march=native -O2 -pipe -fwrapv -DNDEBUG -lpython2.7 -lp
thread -ldl -lutil -lm -L/usr/lib  -lr_core -lr_io -lr_util -shared \
-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu  -lr_core -lr_io -lr_util -shared -fPIC -o lang_python.so
cc -fPIC  -lr_core -lr_io -lr_util -shared -o lang_csharp.so \
        -I/usr/include/libr -lr_util  csharp.c
cc -march=native -O2 -pipe -I/usr/include/libr  -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/include/texlua52 -I/usr/include/tex
luajit    -c -o duktape.o duktape.c
cc -std=c99 -march=native -O2 -pipe -I/usr/include/libr  -Wall -DPREFIX=\"/usr\" -I. -Iduk -I/usr/include/texlua52 -I/usr/in
clude/texluajit  -fPIC  -lr_core -lr_io -lr_util -shared \
        -o lang_duktape.so duktape.c
LANG lang_python.so  lang_csharp.so lang_duktape.so
make[1]: Leaving directory '/var/tmp/portage/dev-libs/radare2-bindings-1.2.1/work/radare2-bindings-1.2.1/libr/lang/p'
make[1]: Entering directory '/var/tmp/portage/dev-libs/radare2-bindings-1.2.1/work/radare2-bindings-1.2.1/cxx'
mod=`echo r_core.so | sed -e s,.so,,` ; \
echo "MOD=$mod" ; \
valabind --cxx -N Radare -m $mod --vapidir=../vapi $mod && \
g++ -shared -fPIC -o r_core.so ${mod}.cxx `pkg-config --cflags --libs $mod`
c++ bindings has been disabled
mod=`echo r_bin.so | sed -e s,.so,,` ; \
echo "MOD=$mod" ; \
valabind --cxx -N Radare -m $mod --vapidir=../vapi $mod && \
g++ -shared -fPIC -o r_bin.so ${mod}.cxx `pkg-config --cflags --libs $mod`
mod=`echo r_asm.so | sed -e s,.so,,` ; \
echo "MOD=$mod" ; \
valabind --cxx -N Radare -m $mod --vapidir=../vapi $mod && \
g++ -shared -fPIC -o r_asm.so ${mod}.cxx `pkg-config --cflags --libs $mod`
MOD=r_core
MOD=r_bin
MOD=r_asm
NOTICE Symbol defined VALABIND_CXX
NOTICE Symbol defined VALABIND_CXX
NOTICE Adding dependency package glib-2.0
NOTICE Adding dependency package gobject-2.0
NOTICE Adding dependency package glib-2.0
NOTICE Adding dependency package gobject-2.0
NOTICE Adding dependency package r_bin
NOTICE Adding dependency package r_util
NOTICE Adding dependency package r_core
NOTICE Adding dependency package r_io
NOTICE Adding dependency package r_cmd
NOTICE Adding dependency package r_util
NOTICE Adding dependency package r_cons
NOTICE Adding dependency package r_anal
NOTICE Adding dependency package r_reg
NOTICE Adding dependency package r_hash
NOTICE Adding dependency package r_egg
NOTICE Adding dependency package r_asm
NOTICE Adding dependency package r_syscall
NOTICE Adding dependency package r_db
NOTICE Adding dependency package r_io
NOTICE Adding dependency package r_bp
NOTICE Adding dependency package r_debug
NOTICE Adding dependency package r_search
NOTICE Adding dependency package r_flags
NOTICE Adding dependency package r_config
NOTICE Adding dependency package r_bin
NOTICE Adding dependency package r_parse
NOTICE Adding dependency package r_lang
NOTICE Adding dependency package r_print
NOTICE Adding dependency package r_fs
NOTICE Adding dependency package r_magic
NOTICE Symbol defined VALABIND_CXX
NOTICE Adding dependency package glib-2.0
NOTICE Adding dependency package gobject-2.0
NOTICE Adding dependency package r_asm
NOTICE Adding dependency package r_util
r_bin.cxx:21:2: error: ‘Radare_RBinFile’ does not name a type
  Radare_RBinFile *self;
r_bin.cxx:25:2: error: ‘Radare_RBinPlugin’ does not name a type
  Radare_RBinPlugin *self;
  ^
r_bin.cxx:29:2: error: ‘Radare_RBinDwarfRow’ does not name a type
  Radare_RBinDwarfRow *self;
  ^
r_bin.cxx:33:2: error: ‘Radare_RBinClass’ does not name a type
  Radare_RBinClass *self;
radare commented 7 years ago

U have an old r2 somewhere in your system

On 19 Feb 2017, at 01:02, Anton Bolshakov notifications@github.com wrote:

Hi I'm getting the following error while compiling the latest 1.2.1. Any idea how to fix it?

g++ -fPIC -shared r_bin_wrap.cxx -DG_BEGIN_DECLS -DG_END_DECLS -DG_GNUC_CONST -DSWIG_PYTHON_SILENT_MEMLEAK -march=native -O2 -pipe -march=native -O2 -pipe -I/usr/include/python2.7 -I/usr/include/python2.7 -march=native -O2 -pipe -DNDEBUG -march=native -O2 -pipe -I/usr/include/libr -o _r_bin.so -lr_magic -lr_socket -lr_io -lr_util -lr_bin -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -L/usr/local/lib -L/usr/pkg/lib -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic r_core.i:1644: Warning 453: Can't apply (RAsmOp OUTPUT). No typemaps are defined. r_core.i:1649: Warning 453: Can't apply (RAsmOp OUTPUT). No typemaps are defined. ... r_asm.so g++ -fPIC -shared r_core_wrap.cxx -DG_BEGIN_DECLS -DG_END_DECLS -DG_GNUC_CONST -DSWIG_PYTHON_SILENT_MEMLEAK -march=native -O2 -pipe -march=native -O2 -pipe -I/usr/include/python2.7 -I/usr/include/python2.7 -march=native -O2 -pipe -DNDEBUG -march=native -O2 -pipe -I/usr/include/libr -o _r_core.so -lr_crypto -lr_magic -lr_fs -lr_socket -lr_syscall -lr_search -lr_reg -lr_egg -lr_bp -lr_parse -lr_anal -lr_io -lr_lang -lr_bin -lr_hash -lr_debug -lr_asm -lr_flag -lr_util -lr_io -lr_cons -lr_config -lr_core -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -L/usr/local/lib -L/usr/pkg/lib -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic r_core_wrap.cxx: In function ‘int RCore_visual_cmd(RCore, char)’: r_core_wrap.cxx:7380:37: error: invalid conversion from ‘char’ to ‘int’ [-fpermissive] return r_core_visual_cmd(self, arg); ^ In file included from r_core_wrap.cxx:3311:0: /usr/include/libr/r_core.h:240:11: note: initializing argument 2 of ‘int r_core_visual_cmd(RCore, int)’ R_API int r_core_visual_cmd(RCore *core, int ch); ^ ... r_core.so ... r_bin.so make[1]: Leaving directory '/var/tmp/portage/dev-libs/radare2-bindings-1.2.1/work/radare2-bindings-1.2.1/python' — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

blshkv commented 7 years ago

that was exactly the case, thank you for the hint. I found an old pyc (byte-compiled) files in python site-packages directory. Thank you for the tip.