Ubuntu: can't find ndbm.h
来源:互联网 发布:飞天侠淘宝客演示 编辑:程序博客网 时间:2024/06/05 21:07
I need to compile an old apache version, 1.3 and compilation process fails because:
mod_auth_dbm.c:77:18: fatal error: ndbm.h: File or directory not found
where is it?
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.
// cc -o ./store dbm_store.c -lgdbm -lgdbm_compat
#include <gdbm-ndbm.h>
#include <stdio.h>
#include <fcntl.h>
#define NAME "Bill"
#define PHONE_NO "123-4567"
#define DB_NAME "phones"
main()
{
DBM *db;
datum name = {NAME, sizeof (NAME)};
datum put_phone_no = {PHONE_NO, sizeof (PHONE_NO)};
datum get_phone_no;
/* Open the database and store the record */
db = dbm_open(DB_NAME, O_RDWR | O_CREAT, 0660);
(void) dbm_store(db, name, put_phone_no, DBM_INSERT);
/* Retrieve the record */
get_phone_no = dbm_fetch(db, name);
(void) printf("Name: %s, Phone Number: %s\n", name.dptr, get_phone_no.dptr);
/* Close the database */
dbm_close(db);
return (0);
}
#include <gdbm-ndbm.h>
#include <stdio.h>
#include <fcntl.h>
#define NAME "Bill"
#define PHONE_NO "123-4567"
#define DB_NAME "phones"
main()
{
DBM *db;
datum name = {NAME, sizeof (NAME)};
datum put_phone_no = {PHONE_NO, sizeof (PHONE_NO)};
datum get_phone_no;
/* Open the database and store the record */
db = dbm_open(DB_NAME, O_RDWR | O_CREAT, 0660);
(void) dbm_store(db, name, put_phone_no, DBM_INSERT);
/* Retrieve the record */
get_phone_no = dbm_fetch(db, name);
(void) printf("Name: %s, Phone Number: %s\n", name.dptr,get_phone_no.dptr);
/* Close the database */
dbm_close(db);
return (0);
}
- Ubuntu: can't find ndbm.h
- Can't find asoundlib.h in Ubuntu 10.04
- Why can't g++ find iostream.h?
- ubuntu wireshark can't find netcard
- 关于"Can't find..."*.pch"或"stdafx.h"的解决方法
- Can't find libcurl or curl/curl.h (RuntimeError)
- CLion提示can't find stdio.h等错误
- can‘t find lmysqlclient
- gem install pg | Can‘t find the ‘libpq-fe.h header
- gem安装patron的时候出现异常: Can't find libcurl or curl/curl.h
- can't find MSVCR80D.dll
- can't find -lperl 解决方法
- can't find main method
- Can't find dependent libraries
- Can't find dependent libraries
- javascript--- Can't find variable: $
- Can't find dependent libraries
- CMake can't find Curses
- java垃圾回收机制详解
- poj 3273(二分)
- Trident API
- 草稿笔记
- 设计模式浅析之--模板方法模式Template Method
- Ubuntu: can't find ndbm.h
- android studio使用说明
- iOS开发之 UI 编程——第一讲
- Storm trident state
- MyBatis的动态SQL详解
- VC2010下Qt5的中文乱码问题
- C++构造函数
- 【LeetCode】001.Two Sum
- OC小游戏-人机大战-猜拳