I need to compile an old Apache version, 1.3, and the compilation process fails because:
mod_auth_dbm.c:77:18: fatal error: ndbm.h: File or directory not found
Where is this ndbm.h file?
I need to compile an old Apache version, 1.3, and the compilation process fails because:
mod_auth_dbm.c:77:18: fatal error: ndbm.h: File or directory not found
Where is this ndbm.h file?
In ubuntu there is apt-file package that allows you to find package which contains specified file.
You need to install it with
sudo apt-get install apt-file
update the cache with
apt-file update
and than you can to search the package you need with
apt-file search ndbm.h
There is only tendra package, that contains file with such name.
Also libgdbm-dev contains /usr/include/gdbm-ndbm.h. May be it's the one you need. You can try to compile with it.
ps. Also you can use search on ubuntu site.
That file here (Fedora 18) belongs to gdbm-devel, the package containing it for Ubuntu should be named similarly. Check the dependencies for the source, you'll probably need a swath of -devel packages corresponding to each dependency.
What do you need an outdated apache, which moreover has known vulnerabilities? Why doesn't the distribution's apache work? It is probably a much better idea to port whatever requires that apache forward than to get stuck in prehistory...
The gdbm sources put the header files in /usr/include/gdbm. Some packaging systems (e.g. Arch Linux) put in symbolic links to those (so /usr/include/ndbm.h points to /usr/include/gdbm/ndbm.h) while at least some Debian-based systems omit the directory AND rename ndbm.h to gdbm-ndbm.h (so they have gdbm.h, dbm.h and gdbm-ndbm.h).
I assume it was to avoid some conflict with a different package, but it's a poor solution.
One way to get around such issues (especially if you don't have permissions to modify the system directories) is to create your own directory, e.g. compat, put in a link from compat/ndbm.h to /usr/include/gdbm-ndbm.h, and then tell the compiler to search your compat directory (-Icompat). Then, if it doesn't find the file in the system libraries it will find the correct name in your own directory.
Since Debian 10 and Ubuntu 18.04 (possibly earlier, but that’s the oldest supported release with this package), the relevant files are available in libgdbm-compat-dev:
apt install libgdbm-compat-dev