Summary:ASTERISK-00760: gastman failed to compile die to db api mis-match
Reporter:cloos (cloos)Labels:
Date Opened:2004-01-08 12:13:58.000-0600Date Closed:2004-09-25 02:18:23
Versions:Frequency of
Description:On my gentoo box, gastman failed to compile with this:

gcc -Wall -g -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -Iinclude -DGTK_ENABLE_BROKEN   -c -o gui.o gui.c
gui.c: In function `gui_init':
gui.c:944: warning: passing arg 2 of pointer to function from incompatible pointer type
gui.c:944: warning: passing arg 4 of pointer to function makes pointer from integer without a ca
gui.c:944: error: too few arguments to function
make: *** [gui.o] Error 1
make: Target `all' not remade because of errors.

Accoding to the c_api.html file, current versions of db require an optional txnid arg to db->open; adding a NULL
arg between fn and DB_TREE on line 944 of gui.c allows it
to compile here.

(txnid is transaction id)
Comments:By: Malcolm Davenport (mdavenport) 2004-01-08 17:02:09.000-0600

Isn't this already in the current CVS?
if ((res = db->open(db, fn,NULL, DB_BTREE,  DB_CREATE, 0664)))

By: Malcolm Davenport (mdavenport) 2004-01-08 17:04:50.000-0600

Resolving pending further note.  This only happens when I remove the NULL argument from the exiting CVS gastman.  Also, this compiles on Gentoo here just fine.

By: cloos (cloos) 2004-01-08 18:00:32.000-0600

It was exacltly current cvs that failed to compile.

cvs had six args to the db->open, but *seven* are required:

(from /usr/share/doc/db-4.1.25/html/api_c/db_open.html)

#include <db.h>

DB->open(DB *db, DB_TXN *txnid, const char *file,
   const char *database, DBTYPE type, u_int32_t flags, int mode);

the NULL that is already there corresponds to the database name, the
new NULL needs to be before fn.

By: cloos (cloos) 2004-01-08 18:04:30.000-0600

Oh, forgot to mention, it is certainly a db version specific issue, which is why I didn't include a patch:  I'm not certain how best to deal with the varying args in each version of db....

By default I get db 4.1.25 from #include <db.h> and -ldb.

db-3.2.9 does not have this txnid arg.

I presume 4.2 does have it.

By: Malcolm Davenport (mdavenport) 2004-01-08 18:46:13.000-0600

Yeah, just noticed that too after your first comment.  Any ideas anyone?

By: Mark Spencer (markster) 2004-02-27 00:43:41.000-0600

Should be fixed in CVS.  Reopen if it's not.