Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Help needed to get dbopen to work.

 
   Soft32 Home -> Linux -> Development RSS
Next:  User defined tag in spec file  
Author Message
Bruce Whittaker

External


Since: Nov 01, 2006
Posts: 1



(Msg. 1) Posted: Wed Nov 01, 2006 10:24 am
Post subject: Help needed to get dbopen to work.
Archived from groups: linux>redhat>devel (more info?)

Hi All,

sorry if this is the wrong newsgroup - if so please let me know. But in case
it's not - here's my problem.

I am using RedHat Linux 2.6.9-1.667smp on a standard intel desktop and I've
written a simple little test program to prove that dbopen works and I just
can't get it to compile properly. I really need help with this one as I'm
really stuck.

The error message I get is as follows,

cc -g -I/usr/include -c dbtest.c -o dbtest.o
dbtest.c: In function `main':
dbtest.c:14: error: `RECNOINFO' undeclared (first use in this function)
dbtest.c:14: error: (Each undeclared identifier is reported only once
dbtest.c:14: error: for each function it appears in.)
dbtest.c:14: error: syntax error before "rec"
dbtest.c:17: error: `rec' undeclared (first use in this function)
dbtest.c:17: error: `R_FIXEDLEN' undeclared (first use in this function)
dbtest.c:26: warning: assignment makes pointer from integer without a cast
cons: *** [dbtest.o] Error 1
cons: errors constructing dbtest.o




the program is as follows.
------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <limits.h>
#include <db.h>

main()
{
DB *ptr;
RECNOINFO rec;
char *fname="test.dat";

rec.flags = R_FIXEDLEN;
rec.cachesize=0; /* use default cachesize */
rec.psize = 0; /* Let system select page size. */
rec.lorder = 0; /* Use current Host ordering. */
rec.reclen = 20;/* 20 byte record length */
rec.bval = '\0';/* Padding char used when fixed length. */
rec.bfname= NULL; /* Don't need to know about internal b-tree. */

ptr = dbopen( fname,(int) O_CREAT|O_EXCL|O_RDWR,(int) S_IWRITE|S_IREAD,
DB_RECNO, (const void *) &rec );
}
Back to top
Login to vote
Display posts from previous:   
Related Topics:
source code for shutdown - Hi, Can anyone tell me where to get the source code for the command shutdown. I would like to port it to my Agenda..

a function to add to newt - If anybody still uses newt, it's got a neat feature to listen on socket descriptors, but no way to remove the socket..

download discountinued redhat-betas? - Hi, does anyone know where i can download discontinued redhat-betas, who have removed from the official server? Greet...

RH 9.0 +glut link problem - All my open GL code that uses the glut library fails to link under RH 9.0. It works fine under RH 8.0. Lib glut can'...

Regina Rexx for redhat 2.1 - Has anyone sucessfully build Regina Rexx 3.01 for RH Linux 2.1AW running on an IA64 Itanium? I got the package and the...

Problem building apache from source RPM on RH9 - I am trying to rebuild apache 2.0.40 from the source RPM for Red Hat 9. Just downloaded and installed SRPMS. and runnin...
       Soft32 Home -> Linux -> Development All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]