undefined reference to `__db_ndbm_open'

Julien ÉLIE julien at trigofacile.com
Fri Aug 2 14:49:27 UTC 2013


Hi The Doctor,

> This morning from inn-CURRENT-20130802
>
> I got
>
> ckpasswd.o: In function `password_dbm':
> /usr/source/inn-CURRENT-20130802/authprogs/ckpasswd.c:170: undefined  
> reference to `__db_ndbm_open'
> /usr/source/inn-CURRENT-20130802/authprogs/ckpasswd.c:175: undefined  
> reference to `__db_ndbm_fetch'
> /usr/source/inn-CURRENT-20130802/authprogs/ckpasswd.c:177: undefined  
> reference to `__db_ndbm_close'
> /usr/source/inn-CURRENT-20130802/authprogs/ckpasswd.c:182: undefined  
> reference to `__db_ndbm_close'

Thanks for the report!
I indeed changed the order of inclusion of DBM headers yesterday.

Could you please tell me the answer of:
   grep DBM config.h
in the include directory?


On the system where I tried to fix a bug, I had:

#define HAVE_BDB_DBM 1
/* #undef HAVE_DB1_NDBM_H */
/* #undef HAVE_DBM */
/* #undef HAVE_GDBM_NDBM_H */
#define HAVE_NDBM_H 1

and similar errors as those you are currently seeing:

/home/iulius/autobuild/inn/authprogs/ckpasswd.c:165: undefined  
reference to `dbm_open'
[...]




I changed:

#if defined(HAVE_DBM) || defined(HAVE_BDB_DBM)
# if HAVE_NDBM_H
#  include <ndbm.h>
# elif HAVE_BDB_DBM
#  define DB_DBM_HSEARCH 1
#  include <db.h>
# elif HAVE_GDBM_NDBM_H
#  include <gdbm-ndbm.h>
# elif HAVE_DB1_NDBM_H
#  include <db1/ndbm.h>
# endif
# define OPT_DBM "d:"
#else
# define OPT_DBM ""
#endif

to:

#if defined(HAVE_DBM) || defined(HAVE_BDB_DBM)
# if HAVE_BDB_DBM
#  define DB_DBM_HSEARCH 1
#  include <db.h>
# elif HAVE_NDBM_H
#  include <ndbm.h>
# elif HAVE_GDBM_NDBM_H
#  include <gdbm-ndbm.h>
# elif HAVE_DB1_NDBM_H
#  include <db1/ndbm.h>
# endif
# define OPT_DBM "d:"
#else
# define OPT_DBM ""
#endif




It looks as though it should be changed to something else, separating  
the initial check for defined(HAVE_DBM) and defined(HAVE_BDB_DBM).

-- 
Julien



More information about the inn-workers mailing list