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 installation cannot find -lvalaccodegen #182

Closed liorko87 closed 5 years ago

liorko87 commented 6 years ago

Hello,

I'm trying to install radare2-bindings on CentOS 7 machine. I followed the instructions at the README and received this error:

In file included from /usr/include/glib-2.0/glib.h:50:0,
                 from /home/centos/valabind/gowriter.c:6:
/usr/include/glib-2.0/glib/ghash.h:99:13: note: expected ‘GHFunc’ but argument is of type ‘void (*)(const void *, const void *, void *)’
 void        g_hash_table_foreach           (GHashTable     *hash_table,
             ^
/usr/bin/ld: cannot find -lvalaccodegen

what is missing at my installation?

radare commented 6 years ago

If you are using an old version of vala you should use an old version of valabind.

Which version of vala are you using?

On 16 Jan 2018, at 12:17, liorbiu notifications@github.com wrote:

Hello,

I'm trying to install radare2-bindings on CentOS 7 machine. I followed the instructions at the README and received this error:

In file included from /usr/include/glib-2.0/glib.h:50:0, from /home/centos/valabind/gowriter.c:6: /usr/include/glib-2.0/glib/ghash.h:99:13: note: expected ‘GHFunc’ but argument is of type ‘void ()(const void , const void , void )’ void g_hash_table_foreach (GHashTable *hash_table, ^ /usr/bin/ld: cannot find -lvalaccodegen what is missing at my installation?

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

liorko87 commented 6 years ago

I'm using the latest version of vala. I download it from vala official site at this link

radare commented 6 years ago

Latest valabind expects vala from git. So its not the last.

Can you paste build logs?

On 16 Jan 2018, at 12:38, liorbiu notifications@github.com wrote:

I'm using the latest version of vala. I download it from vala official site at this link

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

liorko87 commented 6 years ago

At the instructions you are pointing to install vala from tarball and from source, so I installed both of them.

The build logs are:

Generating config.vala
mkdir -p build
Generating config.vala -> build/config.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating main.vala -> build/main.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating valabindwriter.vala -> build/valabindwriter.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating nodeffiwriter.vala -> build/nodeffiwriter.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating utils.vala -> build/utils.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating girwriter.vala -> build/girwriter.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating swigwriter.vala -> build/swigwriter.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating cxxwriter.vala -> build/cxxwriter.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating ctypeswriter.vala -> build/ctypeswriter.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating dlangwriter.vala -> build/dlangwriter.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Generating gowriter.vala -> build/gowriter.vapi
make[1]: Entering directory `/home/centos/valabind'
make[1]: `config.vala' is up to date.
make[1]: Leaving directory `/home/centos/valabind'
Compiling config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala gowriter.vala -> valabind
valac -g --cc="cc"  --vapidir=/usr/local/share/vala/vapi -o valabind --pkg posix --pkg libvala-0.40 --vapidir=/home/centos/valabind/private --pkg ccode --pkg codegen -X -I/home/centos/valabind/private -X -L/usr/local/lib/vala-0.40 -X -lvalaccodegen --save-temps  config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala gowriter.vala 
/usr/share/vala-0.40/vapi/glib-2.0.vapi: In function ‘string_strip’:
/usr/share/vala-0.40/vapi/glib-2.0.vapi:1250:2: warning: passing argument 1 of ‘g_strchug’ discards ‘const’ qualifier from pointer target type [enabled by default]
   result._strip ();
  ^
In file included from /usr/include/glib-2.0/glib.h:79:0,
                 from /home/centos/valabind/valabindwriter.c:6:
/usr/include/glib-2.0/glib/gstrfuncs.h:175:23: note: expected ‘gchar *’ but argument is of type ‘const gchar *’
 gchar*                g_strchug        (gchar        *string);
                       ^
/usr/share/vala-0.40/vapi/glib-2.0.vapi: In function ‘string_strip’:
/usr/share/vala-0.40/vapi/glib-2.0.vapi:1250:2: warning: passing argument 1 of ‘g_strchug’ discards ‘const’ qualifier from pointer target type [enabled by default]
   result._strip ();
  ^
In file included from /usr/include/glib-2.0/glib.h:79:0,
                 from /home/centos/valabind/gowriter.c:6:
/usr/include/glib-2.0/glib/gstrfuncs.h:175:23: note: expected ‘gchar *’ but argument is of type ‘const gchar *’
 gchar*                g_strchug        (gchar        *string);
                       ^
/home/centos/valabind/gowriter.vala: In function ‘go_src_writer_walk_class’:
/home/centos/valabind/gowriter.vala:861:3: warning: passing argument 2 of ‘g_hash_table_foreach’ from incompatible pointer type [enabled by default]
    specializations.foreach((k, v) => {
   ^
In file included from /usr/include/glib-2.0/glib.h:50:0,
                 from /home/centos/valabind/gowriter.c:6:
/usr/include/glib-2.0/glib/ghash.h:99:13: note: expected ‘GHFunc’ but argument is of type ‘void (*)(const void *, const void *, void *)’
 void        g_hash_table_foreach           (GHashTable     *hash_table,
             ^
/usr/bin/ld: cannot find -lvalaccodegen
collect2: error: ld returned 1 exit status
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
make: *** [valabind] Error 1
radare commented 6 years ago

Valabind cant be compiled with vala 0.38.4 because the internal compiler APIs are compiled statically and not available to link against,, you may use the last unstable release 0.39.x or wait for 0.40 that may appear soon, for now i would opt for vala from git.

Ive been discussing with the vala devs because of the inabiilty to build valabind, and thats why i had to split the build steps.

On 16 Jan 2018, at 12:48, liorbiu notifications@github.com wrote:

At the instructions you are pointing to install vala from tarball and from source, so I installed both of them.

The build logs are:

Generating config.vala mkdir -p build Generating config.vala -> build/config.vapi make[1]: Entering directory /home/centos/valabind' make[1]:config.vala' is up to date. make[1]: Leaving directory /home/centos/valabind' Generating main.vala -> build/main.vapi make[1]: Entering directory/home/centos/valabind' make[1]: config.vala' is up to date. make[1]: Leaving directory/home/centos/valabind' Generating valabindwriter.vala -> build/valabindwriter.vapi make[1]: Entering directory /home/centos/valabind' make[1]:config.vala' is up to date. make[1]: Leaving directory /home/centos/valabind' Generating nodeffiwriter.vala -> build/nodeffiwriter.vapi make[1]: Entering directory/home/centos/valabind' make[1]: config.vala' is up to date. make[1]: Leaving directory/home/centos/valabind' Generating utils.vala -> build/utils.vapi make[1]: Entering directory /home/centos/valabind' make[1]:config.vala' is up to date. make[1]: Leaving directory /home/centos/valabind' Generating girwriter.vala -> build/girwriter.vapi make[1]: Entering directory/home/centos/valabind' make[1]: config.vala' is up to date. make[1]: Leaving directory/home/centos/valabind' Generating swigwriter.vala -> build/swigwriter.vapi make[1]: Entering directory /home/centos/valabind' make[1]:config.vala' is up to date. make[1]: Leaving directory /home/centos/valabind' Generating cxxwriter.vala -> build/cxxwriter.vapi make[1]: Entering directory/home/centos/valabind' make[1]: config.vala' is up to date. make[1]: Leaving directory/home/centos/valabind' Generating ctypeswriter.vala -> build/ctypeswriter.vapi make[1]: Entering directory /home/centos/valabind' make[1]:config.vala' is up to date. make[1]: Leaving directory /home/centos/valabind' Generating dlangwriter.vala -> build/dlangwriter.vapi make[1]: Entering directory/home/centos/valabind' make[1]: config.vala' is up to date. make[1]: Leaving directory/home/centos/valabind' Generating gowriter.vala -> build/gowriter.vapi make[1]: Entering directory /home/centos/valabind' make[1]:config.vala' is up to date. make[1]: Leaving directory `/home/centos/valabind' Compiling config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala gowriter.vala -> valabind valac -g --cc="cc" --vapidir=/usr/local/share/vala/vapi -o valabind --pkg posix --pkg libvala-0.40 --vapidir=/home/centos/valabind/private --pkg ccode --pkg codegen -X -I/home/centos/valabind/private -X -L/usr/local/lib/vala-0.40 -X -lvalaccodegen --save-temps config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala gowriter.vala /usr/share/vala-0.40/vapi/glib-2.0.vapi: In function ‘string_strip’: /usr/share/vala-0.40/vapi/glib-2.0.vapi:1250:2: warning: passing argument 1 of ‘g_strchug’ discards ‘const’ qualifier from pointer target type [enabled by default] result._strip (); ^ In file included from /usr/include/glib-2.0/glib.h:79:0, from /home/centos/valabind/valabindwriter.c:6: /usr/include/glib-2.0/glib/gstrfuncs.h:175:23: note: expected ‘gchar ’ but argument is of type ‘const gchar ’ gchar g_strchug (gchar string); ^ /usr/share/vala-0.40/vapi/glib-2.0.vapi: In function ‘string_strip’: /usr/share/vala-0.40/vapi/glib-2.0.vapi:1250:2: warning: passing argument 1 of ‘g_strchug’ discards ‘const’ qualifier from pointer target type [enabled by default] result._strip (); ^ In file included from /usr/include/glib-2.0/glib.h:79:0, from /home/centos/valabind/gowriter.c:6: /usr/include/glib-2.0/glib/gstrfuncs.h:175:23: note: expected ‘gchar ’ but argument is of type ‘const gchar ’ gchar g_strchug (gchar string); ^ /home/centos/valabind/gowriter.vala: In function ‘go_src_writer_walk_class’: /home/centos/valabind/gowriter.vala:861:3: warning: passing argument 2 of ‘g_hash_table_foreach’ from incompatible pointer type [enabled by default] specializations.foreach((k, v) => { ^ In file included from /usr/include/glib-2.0/glib.h:50:0, from /home/centos/valabind/gowriter.c:6: /usr/include/glib-2.0/glib/ghash.h:99:13: note: expected ‘GHFunc’ but argument is of type ‘void ()(const void , const void , void )’ void g_hash_table_foreach (GHashTable *hash_table, ^ /usr/bin/ld: cannot find -lvalaccodegen collect2: error: ld returned 1 exit status error: cc exited with status 256 Compilation failed: 1 error(s), 0 warning(s) make: *** [valabind] Error 1

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

liorko87 commented 6 years ago

I deleted vala 0.38.4 from my machine, and installed the vala from git. I'm working on branch master of vala, but I'm still getting the same error.
build log attached:

Compiling config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala gowriter.vala -> valabind
valac -g --cc="cc"  --vapidir=/usr/local/share/vala/vapi -o valabind --pkg posix --pkg libvala-0.40 --vapidir=/home/centos/valabind/private --pkg ccode --pkg codegen -X -I/home/centos/valabind/private -X -L/usr/local/lib/vala-0.40 -X -lvalaccodegen --save-temps  config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala gowriter.vala 
/usr/share/vala-0.40/vapi/glib-2.0.vapi: In function ‘string_strip’:
/usr/share/vala-0.40/vapi/glib-2.0.vapi:1250:2: warning: passing argument 1 of ‘g_strchug’ discards ‘const’ qualifier from pointer target type [enabled by default]
   result._strip ();
  ^
In file included from /usr/include/glib-2.0/glib.h:79:0,
                 from /home/centos/valabind/valabindwriter.c:6:
/usr/include/glib-2.0/glib/gstrfuncs.h:175:23: note: expected ‘gchar *’ but argument is of type ‘const gchar *’
 gchar*                g_strchug        (gchar        *string);
                       ^
/usr/share/vala-0.40/vapi/glib-2.0.vapi: In function ‘string_strip’:
/usr/share/vala-0.40/vapi/glib-2.0.vapi:1250:2: warning: passing argument 1 of ‘g_strchug’ discards ‘const’ qualifier from pointer target type [enabled by default]
   result._strip ();
  ^
In file included from /usr/include/glib-2.0/glib.h:79:0,
                 from /home/centos/valabind/gowriter.c:6:
/usr/include/glib-2.0/glib/gstrfuncs.h:175:23: note: expected ‘gchar *’ but argument is of type ‘const gchar *’
 gchar*                g_strchug        (gchar        *string);
                       ^
/home/centos/valabind/gowriter.vala: In function ‘go_src_writer_walk_class’:
/home/centos/valabind/gowriter.vala:861:3: warning: passing argument 2 of ‘g_hash_table_foreach’ from incompatible pointer type [enabled by default]
    specializations.foreach((k, v) => {
   ^
In file included from /usr/include/glib-2.0/glib.h:50:0,
                 from /home/centos/valabind/gowriter.c:6:
/usr/include/glib-2.0/glib/ghash.h:99:13: note: expected ‘GHFunc’ but argument is of type ‘void (*)(const void *, const void *, void *)’
 void        g_hash_table_foreach           (GHashTable     *hash_table,
             ^
/usr/bin/ld: cannot find -lvalaccodegen
collect2: error: ld returned 1 exit status
error: cc exited with status 256
mckuok commented 6 years ago

Same problem here. Does anyone have a fix?

radare commented 6 years ago

Ther s no fix. Vala is not exposing any of the internal apis that are required for valabind to work. Other projects like valadoc are also affected.

The only possible fix is use old version of vala or latest unstable release or git

On 23 Jan 2018, at 04:00, Man Chon Kuok notifications@github.com wrote:

Same problem here. Does anyone has a fix?

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

mckuok commented 6 years ago

@radare Which version of Vala (https://wiki.gnome.org/Projects/Vala/Release) do you recommend us to install?

Edit: I tried with 0.39.5 and got passed the missing valaccodegen error

radare commented 6 years ago

Last unstable or git. See the travis.yml from valabind

On 23 Jan 2018, at 22:01, Man Chon Kuok notifications@github.com wrote:

@radare Which version of Vala (https://wiki.gnome.org/Projects/Vala/Release) do you recommend us to install?

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

XVilka commented 6 years ago

So, was this solved?

radare commented 6 years ago

Yes. Its just up to the distros to upgrade vala

On 7 May 2018, at 06:13, Anton Kochkov notifications@github.com wrote:

So, was this solved?

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