我试图为 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/