<DIV>Hi</DIV>  <DIV>I want to define extention module that connect to berkeley db.</DIV>  <DIV>I define function for connection to berkeley db with c language in one file and define other function for create extention module that can import from python.</DIV>  <DIV> function for connection to berkeley db is like this:</DIV>  <DIV>name=BDB.c</DIV>  <DIV>---------------------------------------------</DIV>  <DIV>#include <db.h><BR>void CreateDatabase(char *databasename){<BR>DB *dbp ;<BR>int ret;<BR>DB_ENV *myEnv;<BR>u_int32_t env_flags;<BR>char *databasename;<BR>ret = db_env_create(&myEnv, 0);<BR>if (ret != 0) {<BR>fprintf(stderr, "Error creating env handle: %s\n", db_strerror(ret));<BR>return -1;<BR>}<BR>env_flags = DB_CREATE |DB_INIT_MPOOL;<BR>if((ret = myEnv->open(myEnv,"env55", env_flags , 0))!=0){<BR>fprintf(stderr, "Error open environment: %s\n",
 db_strerror(ret));<BR>}<BR>db_create(&dbp,myEnv,0);<BR>dbp->open(dbp,NULL,"university",databasename,DB_BTREE,DB_CREATE,0);<BR>}<BR>---------------------------------------------------------------------------------------------------------------</DIV>  <DIV>function for define extention module is like this:</DIV>  <DIV>name=importBDB.c</DIV>  <DIV>------------------------------------------------------------------------</DIV>  <DIV>#include <Python.h><BR>#include <db.h></DIV>  <DIV>CreateDatabase(char *);<BR>static PyObject<BR>*insert_data(PyObject *self,PyObject *args) {<BR>char *databasename;<BR>if (!PyArg_ParseTuple(args, "s", &databasename)) {<BR>return NULL;<BR>}<BR>CreateDatabase(databasename);<BR>Py_RETURN_NONE;<BR>}<BR>static PyMethodDef data_methods[] = {<BR>{ "data", (PyCFunction)insert_data, METH_VARARGS, NULL },<BR>{ NULL, NULL, 0, NULL }<BR>};<BR>PyMODINIT_FUNC initdata() {<BR>Py_InitModule3("data", data_methods, "My first extension
 module.");<BR>}<BR>----------------------------------------------------------------------------------------------------------</DIV>  <DIV>my compiler is gcc and compiling it with this command:</DIV>  <DIV> </DIV>  <DIV>gcc -shared -I/usr/local/include/python2.4 -I/usr/local/BerkeleyDB.4.5/include   \ importBDB.c BDB.c \ -L/usr/local/BerkeleyDB.4.5/lib -ldb-4.5 -o insert.so</DIV>  <DIV> </DIV>  <DIV>there is an error occurs like this:</DIV>  <DIV>gcc:  importBDB.c: No such file or directory<BR>gcc:  -L/usr/local/BerkeleyDB.4.5/lib: No such file or directory<BR></DIV>  <DIV>I know problem for compiler please help me</DIV>  <DIV> </DIV>  <DIV>regards</DIV>  <DIV>saeed </DIV><p> __________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com