PDA

View Full Version : [berkley db] problemi con open


NA01
03-04-2005, 11:47
ho rimesso mano alle mie scarse conoscenze di questo db per fare un programmino stupidissimo.
ho scritto qualcosa come mi ricordavo e non andava nulla. mi dava un'errore sulla open.
sono andato sulla documentazione nel tarrball dei sorgenti e dà ragione al mio codice :eek:
peccato che anche un copia incolla dell'esempio non funziona assolutamente

l'esempio è questo

#include <db.h>

int main(){
DB *dbp; /* DB structure handle */
u_int32_t flags; /* database open flags */
int ret; /* function return value */

/* Initialize the structure. This
* database is not opened in an environment,
* so the environment pointer is NULL. */
ret = db_create(&dbp, NULL, 0);
if (ret != 0) {
/* Error handling goes here */
}

/* Database open flags */
flags = DB_CREATE; /* If the database does not exist,
* create it.*/

/* open the database */
ret = dbp->open(dbp, /* DB structure pointer */
NULL, /* Transaction pointer */
"my_db.db", /* On-disk file that holds the database. */
NULL, /* Optional logical database name */
DB_BTREE, /* Database access method */
flags, /* Open flags */
0); /* File mode (using defaults) */
if (ret != 0) {
/* Error handling goes here */
}
}


ed ecco a voi l'errore


ultio@NA01:~$ gcc db.c -ldb-4.2
db.c: In function `main':
db.c:27: error: incompatible type for argument 4 of indirect function call
db.c:27: error: too many arguments to function




.....
aiuuuuuuuuuttttttttoooooooooooooooo!!!! :D


ciao

NA01
03-04-2005, 11:56
mmmmhhh
sembra essere un problema conosciuto con alcune configurazioni del kernel sul 4.2. a quanto ho letto la 4.3 risolve questo problema....

la sto ricompilando ora


ciao

NA01
03-04-2005, 11:59
come non detto, non va ancora nulla :(

ciao

NA01
03-04-2005, 18:38
stessa cosa con il c++.....


ho provato a usare gli header della serie 3.x, ma nulla :cry:

aiutooooooooooooooooooooooo!!!!

RaouL_BennetH
03-04-2005, 19:11
non so se può servirti, ma ho trovato questo link:

http://sourceforge.net/mailarchive/forum.php?thread_id=1696126&forum_id=4892

Ho notato però che in molti con berkleydb hanno quest'errore.