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
有什么建议吗?
I was trying to compile the mongodbbackend module for powerdns but I'm stuck with this problem:
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
I tried to include files from mongodb 2.0.2 and 2.0.3.
Here are the module sources:
http://wiki.powerdns.com/trac/browser/trunk/pdns/modules/mongodbbackend
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Ruben 的帖子是我的匿名/非帐户帖子。我没有看格式,所以帖子有点乱。
您可以通过添加以下内容来克服编译器错误:
#include
并将第 109 行更改为:
auto_ptr光标;
到
std::auto_ptr但是,这
会导致我出现其他错误(请参阅 http://pastebin.com/Wm60JCDu)。不过,它可能对您有用:-)
如果您提供有关您的环境的更多信息(发行版、mangodb 的版本以及使用的 mango 驱动程序),将会很有帮助。
The post from Ruben is my anonymous/non-account post. I didn't look at the formatting so the post is a little messed up.
The compiler error you have can be overcome by adding:
#include<memory>
And changing line 109 from:
auto_ptr<mongo::DBClientCursor> cursor;
to
std::auto_ptr<mongo::DBClientCursor> cursor;
This, however, causes other errors on my end (see http://pastebin.com/Wm60JCDu). It might work for you though :-)
It would be helpful if you provide more info about your environment (distro, what version of mangodb and the used mango driver).
你能试试这个补丁吗?
diff --git a/modules/mongodbbackend/mongodbbackend.hh b/modules/mongodbbackend/mongodbbackend.hh
索引 816128f..4f7cf78 100644
--- a/modules/mongodbbackend/mongodbbackend.hh
+++ b/modules/mongodbbackend/mongodbbackend.hh
@@ -1,13 +1,13 @@
#ifndef MONGODB_HH
#define MONGODB_HH
它位于 https://github.com/azlev/powerdns/commit/a402d8493e5610e139ea19a9ef700e26b2e6e35c
Can you try this patch?
diff --git a/modules/mongodbbackend/mongodbbackend.hh b/modules/mongodbbackend/mongodbbackend.hh
index 816128f..4f7cf78 100644
--- a/modules/mongodbbackend/mongodbbackend.hh
+++ b/modules/mongodbbackend/mongodbbackend.hh
@@ -1,13 +1,13 @@
#ifndef MONGODB_HH
#define MONGODB_HH
It's in https://github.com/azlev/powerdns/commit/a402d8493e5610e139ea19a9ef700e26b2e6e35c
您可以通过添加以下内容来克服编译错误:
并更改
为
mangobackend.hh
中的 108/109/110 行周围它可能对您有用,但我认为它是很大程度上取决于您使用的 mangodb-api。
如果您提供有关您的环境的更多信息(发行版、芒果版本等),将会很有帮助
The compile error you have can be overcome by adding:
and changing
to
around line 108/109/110 in
mangobackend.hh
It might work for you, but I think it is heavily depending on the mangodb-api you're using.
It would be helpfull if you provide more info around your environment (distro, version of mango, etc)