SPUG: c question ;)

Benjamin Franks benjamin at dzhan.com
Tue Apr 16 11:56:22 CDT 2002

I seem to be asking as many c questions as perl questions on this list,
but I get great responses...so here's another. ;)

I'm including "ndbm.h" for some basic database store/fetch routines in a c
program.  I'd like to be able to compile my program easily on different
*nixes with different base database libraries.  I know "gdbm.h" and the
berkeley "db.h" provide compatibility with ndbm, as well as things like
"db1/ndbm.h" on linux.  Is there a standard way to detect which database
library is present and include that one?  Should I be use preprocessor
directives like IFDEF...or a Makefile?  Also, I notice that sometimes I
need to link with a shared library version during compilation with an
option like "-l ndbm".  How would I detect if a shared library needs to be

Any relevant info sources or examples would be great.


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org

More information about the spug-list mailing list