对 OS X 上安装的 Berkeley db C api 有很好的介绍吗?
我正在寻找关于 OS X 上安装的 Berkeley db api 的良好介绍。我查看了此 Oracle 文档:http://download.oracle.com/docs/cd/E17076_02/html/gsg/C/BerkeleyDB-Core-C-GSG .pdf
这似乎是较新的版本。我无法编译它并收到以下错误:
test.c:23: error: ‘DB_CREATE’ undeclared (first use in this function)
test.c:23: error: (Each undeclared identifier is reported only once
test.c:23: error: for each function it appears in.)
test.c:26: error: ‘DB’ has no member named ‘open’
test.c:42: error: too many arguments to function ‘dbp->close’
据我所知,OS X 上安装的版本是旧的 BSD 许可 1.85。
I'm looking for a good introduction to the Berkeley db api that is installed on OS X. I have looked at this Oracle document: http://download.oracle.com/docs/cd/E17076_02/html/gsg/C/BerkeleyDB-Core-C-GSG.pdf
Which seems to be a newer version. I am not able to compile this and get the following error:
test.c:23: error: ‘DB_CREATE’ undeclared (first use in this function)
test.c:23: error: (Each undeclared identifier is reported only once
test.c:23: error: for each function it appears in.)
test.c:26: error: ‘DB’ has no member named ‘open’
test.c:42: error: too many arguments to function ‘dbp->close’
AFAIK, the version installed on OS X is the old BSD licensed 1.85.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DB 1.85 仅支持某些系统配置文件,例如
/etc/pwd.db
,因此不应该真正使用它。话虽这么说,它比较新的 Berkeley DB 版本简单得多。
dbopen(3)
是一个好的开始。DB 1.85 is only there to support some system configuration files such as
/etc/pwd.db
, so it shouldn't really be used.That being said, it is much simpler than the newer Berkeley DB releases.
dbopen(3)
is a good start.我在苹果的支持网站上进行了快速搜索。看起来 Mac OS X 上可能安装了 Berkeley DB 的更新版本。我发现 Berkeley DB 4.2 安装在 Mac OS X Server v10.5 上并在 Open Directory Server 中使用。
I did a quick search on Apple's support site. It looks like there are probably more recent releases of Berkeley DB installed on Mac OS X. I found that Berkeley DB 4.2 is installed on Mac OS X Server v10.5 and used in the Open Directory Server.