gerbil icon indicating copy to clipboard operation
gerbil copied to clipboard

Error compiling gerbil with liblmdb on Debian 10

Open belmarca opened this issue 6 years ago • 3 comments

I cannot compile gerbil with the lmdb feature enabled with liblmdb-dev 0.9.22-1 and liblmdb++-dev 0.9.14.1+git20160228.0b43ca8-1 installed on Debian 10 with gcc (Debian 8.3.0-6) 8.3.0.

... compile foreign db/_lmdb
../../../src/std/db/_lmdb.c: In function ‘int ffi_mdb_cursor_get(MDB_cursor*, long int, MDB_val*, long int, MDB_val*, unsigned int)’:
../../../src/std/db/_lmdb.c:1668:50: error: invalid conversion from ‘unsigned int’ to ‘MDB_cursor_op’ [-fpermissive]
  return mdb_cursor_get (cursor, keyval, dataval, op);
                                                  ^~
In file included from ../../../src/std/db/_lmdb.c:1579:
/usr/include/lmdb.h:1446:22: note:   initializing argument 4 of ‘int mdb_cursor_get(MDB_cursor*, MDB_val*, MDB_val*, MDB_cursor_op)’
        MDB_cursor_op op);
        ~~~~~~~~~~~~~~^~
*** ERROR IN ##main -- target compilation or link failed while compiling "~/dev/gerbil/src/std/db/_lmdb.scm"
*** ERROR IN std/make#gsc-compile, "make.ss"@420.7 -- Compilation error; gsc exited with nonzero status 17920
*** ERROR; build failed

I am trying a quick fix by defining the proper types.

belmarca avatar Aug 08 '19 18:08 belmarca

I compiled gambit with --enable-cplusplus. The issue is probably due to that, as referenced here: https://mailman.iro.umontreal.ca/pipermail/gambit-list/2012-February/005678.html.

belmarca avatar Aug 08 '19 18:08 belmarca

probably some casting needed, which is a known problem with c++ compilers.

vyzo avatar Aug 08 '19 18:08 vyzo

I'm going to try Marc's macro described here: https://mailman.iro.umontreal.ca/pipermail/gambit-list/2012-February/005688.html.

belmarca avatar Aug 08 '19 18:08 belmarca