c++ - powerdns + mongodb

标签 c++ c mongodb compilation powerdns

我试图为 powerdns 编译 mongodbbackend 模块,但我遇到了这个问题:

In file included from mongodbbackend.cc:18:
mongodbbackend.hh: At global scope:
mongodbbackend.hh:109: error: ISO C++ forbids declaration of ‘auto_ptr’ with no type
mongodbbackend.hh:109: error: expected unqualified-id before ‘<’ token
make[3]: *** [mongodbbackend.lo] Error 1
make[3]: Leaving directory `/root/pdns-3.0.1/modules/mongodbbackend'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/pdns-3.0.1/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/pdns-3.0.1'
make: *** [all] Error 2

我试图包含来自 mongodb 2.0.2 和 2.0.3 的文件。 以下是模块源: http://wiki.powerdns.com/trac/browser/trunk/pdns/modules/mongodbbackend

有什么建议吗?

最佳答案

Ruben 的帖子是我的匿名/非帐户帖子。我没有看格式,所以帖子有点乱。

您遇到的编译器错误可以通过添加以下内容来克服:

#include<memory>

并更改第 109 行:

auto_ptr<mongo::DBClientCursor> cursor;

std::auto_ptr<mongo::DBClientCursor> cursor;

然而,这会导致我的其他错误(参见 http://pastebin.com/Wm60JCDu )。不过它可能对你有用 :-)

如果您提供有关您的环境的更多信息(发行版、mangodb 的版本和使用的 mango 驱动程序),将会很有帮助。

关于c++ - powerdns + mongodb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9405663/

相关文章:

python - 从 GridFS Python Flask Mongodb 检索和显示图像

node.js - 使用javascript、游标方法进行mongodb查询

c++ - Raspberry Pi 上的浮点性能(ARM 架构,BCM2835)

c++ - 成员是私有(private)的,C++ 中的运算符重载

c++ - 为什么将多个元素同时插入 std::set 会更快?

c - getch() 的文件描述符

c++ - 在带或不带命名空间的 <cstdint> 中使用类型

c - 如果一个函数没有返回,执行栈会发生什么?

c - C-错误:下标值既不是数组也不是指针

MongoDB:只更新嵌套数组的一个对象