Abrogans
Abrogans

Reputation: 189

How to fix "r_cons.h/r_types.h:no such file or directory" while installing r2dec

I'm trying to install r2dec plugin for radare2. The Build fails because there are some files missing.

first I did run following commands

$r2pm init

then

$r2pm init

then i tried to install it with :

$r2pm -i r2dec

When the build failed I installed npm because a comment on this answer suggested it https://stackoverflow.com/a/51466052/10854709

$sudo apt install nodejs

Expected output would be a successful build.

the actual output is the following:

Install Done For r2dec make: Entering directory '/home/me/.local/share/radare2/r2pm/git/r2dec-js/p' cc -I/home/me/.local/share/radare2/prefix/include -g -O3 -I/usr/include/libr -I./duktape -L/home/me/.local/share/radare2/prefix/lib -lr_core -lr_config -lr_debug -lr_bin -lr_anal -lr_bp -lr_egg -lr_asm -lr_lang -lr_parse -lr_flag -lr_cons -lr_reg -lr_search -lr_syscall -lr_fs -lr_io -lr_socket -lr_magic -lr_crypto -lr_hash -lr_util -ldl -lm -std=c99 -shared -fPIC duktape/duktape.c duktape/duk_console.c core_pdd.c -o core_pdd.so

duktape/duk_console.c:13:20: fatal error: r_cons.h: No such file or directory

[..]
core_pdd.c:8:21: fatal error: r_types.h: No such file or directory

[..]

compilation terminated. Makefile:10: recipe for target 'all' failed make: *** [all] Error 1 make: Leaving directory '/home/me/.local/share/radare2/r2pm/git/r2dec-js/p'

Upvotes: 2

Views: 1687

Answers (3)

user1864497
user1864497

Reputation: 11

If you install radare2 using a package manager you may not have the header files for radare2 itself (and if you're using the github repo I guess the r2pm installer isn't pointing to it or something?.

You only need to install radare2-devel....or whatever package it is for your system then r2dec will build okay. The relevant headers are part of that package.

For me on Fedora,

dnf install radare2-devel

Upvotes: 1

Tom Marshall
Tom Marshall

Reputation: 36

libzip is one of the requirements to install r2dec. For some reason, I cannot find the webpage that explained the dependency, but I remember seeing it. libzip was already installed, but the "dev" package, which contains the headers for the library, wasn't. Installing libzip-dev seemed to resolve the issue.

Upvotes: 1

William Taylor
William Taylor

Reputation: 629

Try this: sudo apt install pkg-config

Upvotes: 4

Related Questions