radareorg / radare2-bindings

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

Error when installing r2api-python #177

Closed raulsiles closed 6 years ago

raulsiles commented 6 years ago

Following the r2 installation instructions at https://github.com/radare/radare2, r2 properly installs for the user (not system-wide) in macOS High Sierra:

$ git clone https://github.com/radare/radare2.git
$ cd radare2
$ sys/user.sh

Then, after successfully initializing the package manager with r2pm init, I proceed to install the Python bindings:

$ r2pm install lang-python2
$ r2pm install r2api-python
...
==> Using valabind 1.4
==> Using swig 3.0.12
...

The first command completed successfully, but the second one generates the following errors:

r_core_wrap.cxx:7410:10: error: no matching function for call to 'r_core_asm_strsearch'
                list = r_core_asm_strsearch (self, input, from, to, maxhits, regexp);
                       ^~~~~~~~~~~~~~~~~~~~
/Users/<u>/bin/prefix/radare2//include/libr/r_core.h:417:14: note: candidate function not viable: requires 7 arguments, but 6 were provided
R_API RList *r_core_asm_strsearch(RCore *core, const char *input, ut64 from, ut64 to, int maxhits, int regexp, int everyByte);
             ^
r_core_wrap.cxx:7542:20: warning: expression result unused [-Wunused-value]
                r_list_iter_free(self);
                                 ^~~~
/Users/<u>/bin/prefix/radare2//include/libr/r_list.h:70:29: note: expanded from macro 'r_list_iter_free'
#define r_list_iter_free(x) x
                            ^
r_core_wrap.cxx:7794:10: error: no matching function for call to 'r_meta_del'
                return r_meta_del(self, type, from, size, str);
                       ^~~~~~~~~~
/Users/<u>/bin/prefix/radare2//include/libr/r_anal.h:1521:11: note: candidate function not viable: requires 4 arguments, but 5 were provided
R_API int r_meta_del(RAnal *m, int type, ut64 from, ut64 size);
          ^
1 warning and 2 errors generated.

BTW, I started with a make purge to clean up potential files from previous r2 versions. Python version is 2.7.13.

radare commented 6 years ago

pls confirm its fixed

radare commented 6 years ago

if not check the last commit and send a pr adjusting the vapi files

raulsiles commented 6 years ago

After the last commit https://github.com/radare/radare2-bindings/blob/da5fa8df7dd99a460ebe383c175d4449908a1676/vapi/r_core.vapi the "r_core_asm_strsearch" error has been fixed, but the "r_meta_del" error still remains:

r_core_wrap.cxx:7531:20: warning: expression result unused [-Wunused-value]
                r_list_iter_free(self);
                                 ^~~~
/Users/<u>/bin/prefix/radare2//include/libr/r_list.h:70:29: note: expanded from macro 'r_list_iter_free'
#define r_list_iter_free(x) x
                            ^
r_core_wrap.cxx:7783:10: error: no matching function for call to 'r_meta_del'
                return r_meta_del(self, type, from, size, str);
                       ^~~~~~~~~~
/Users/<u>/bin/prefix/radare2//include/libr/r_anal.h:1521:11: note: candidate function not viable: requires 4 arguments, but 5 were provided
R_API int r_meta_del(RAnal *m, int type, ut64 from, ut64 size);
          ^
1 warning and 1 error generated.

I have submitted a PR for "vapi/r_anal.vapi" that fixes that second error too: https://github.com/radare/radare2-bindings/pull/178

Thanks for the reference and guidance!

radare commented 6 years ago

Cool thanks!

Those bindings are not recommended to be used because they leak, crash and are not complete. We need more human power to maintain those and actually the r2pipe is easier to use and maintain

Thanks anyway :)

On 14 Nov 2017, at 05:50, Raul Siles notifications@github.com wrote:

After the last commit https://github.com/radare/radare2-bindings/blob/da5fa8df7dd99a460ebe383c175d4449908a1676/vapi/r_core.vapi the "r_core_asm_strsearch" error has been fixed, but the "r_meta_del" error still remains:

r_core_wrap.cxx:7531:20: warning: expression result unused [-Wunused-value] r_list_iter_free(self); ^~~~ /Users//bin/prefix/radare2//include/libr/r_list.h:70:29: note: expanded from macro 'r_list_iter_free'

define r_list_iter_free(x) x

                        ^

r_core_wrap.cxx:7783:10: error: no matching function for call to 'r_meta_del' return r_meta_del(self, type, from, size, str); ^~~~~~ /Users//bin/prefix/radare2//include/libr/r_anal.h:1521:11: note: candidate function not viable: requires 4 arguments, but 5 were provided R_API int r_meta_del(RAnal *m, int type, ut64 from, ut64 size); ^ 1 warning and 1 error generated. I have submitted a PR for "vapi/r_anal.vapi" that fixes that second error too:

178

Thanks for the reference and guidance!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

raulsiles commented 6 years ago

Thanks! Installation works fine now :) This issue can be closed.