holotko wrote:

> I have an old program here that was coded a few years ago and it
> utilizes a few of the basic dbm " barely a database" functions such as
> "dbm_open()" , "dbm_close()", "dbm_fetch()" and "dbm_store()". This
> system was recently upgraded to RedHat vers. 5.0/ w glibc".
>
> In the past when I needed to compile a program using these functions I
> would do this:
>
> $ gcc -o foo foo.c -ldbm
>
> However when I try to do this now I get a message saying  "cannot open
> -ldbm - no such file or directory".  At first I figured that I need to
> specify a path but, apparently this library is no longer available as I
> could not locate it on the system. Yet the header "/usr/include/ndbm.h"
> is.
>
> Is there a way around this problem?? Is this library available under
> another name perhaps, or is this functionality now included as part of
> another library perhaps. Or do I need to open the source code and modify
> the program to utilize an entirely different database structure??
>
> Thank You..

Thanks for all the help and suggestions concerning this question. Actually,
soon after I sent this out I sort of figured out what was the problem.
Checking some of the documentation I discovered the GNU implementation of
dbm , or gdbm, was installed. In the source code I replaced the header file
"ndbm.h" with "gbbm.h". Also, I noted that some of the functions had
changed somewhat, mostly the names, i.e. dbm_fetch() ---> gdbm_fetch,
dbm_store() --> gdbm_store(), etc. Most notably different under gdbm was
gdbm_open(), in which the parameter list was slightly different. Also, when
declaring the pointer I had to use "GDBM_FILE  dbm" as opposed to "DBM
*dbm;". All in all the differences between the older implementation of dbm,
and the new GNU gdbm impl. appeared to be relatively minor, at least as far
as the most basic functions are concerned. it didn't take me too long to
modify my source and get the project to recompile and run satisfactorily.

I haven't had a chance to examine the documentation thoroughly but, it
appears that the newer, GNU gdbm version of dbm may add a bit of
functionality (additional functions, etc...) that were not present in the
older versions.Perhaps someone else is a bit more aware of whether or not
such is the case, although it did appear that way as I skimmed through the
docs yesterday.

Someone also pointed out the name  of the library to link to in order to
utilize the old functions "-ldb" I believe....

In any event I really appreciate all the helpful suggestions. keep up the
great work...

/John
/ [EMAIL PROTECTED]




>
>
> /John
> / [EMAIL PROTECTED]
>
> --
> email: [EMAIL PROTECTED]
> Local mailserver  , remote
>
> Stamp out oppression!!



--
email: [EMAIL PROTECTED]
Local mailserver  , remote

Stamp out oppression!!


Reply via email to