powerdns +蒙古数据库

发布于 2025-01-08 10:12:21 字数 867 浏览 3 评论 0原文

我试图为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

¢好甜 2025-01-15 10:12:21

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).

铁憨憨 2025-01-15 10:12:21

你能试试这个补丁吗?

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

+#include "client/dbclient.h"
 #include "pdns/dnsbackend.hh"

 #undef VERSION
 #include <string>
 using std::string;
-
-#include "client/dbclient.h"
+using std::auto_ptr;

 class MONGODBException {
 public:

它位于 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

+#include "client/dbclient.h"
 #include "pdns/dnsbackend.hh"

 #undef VERSION
 #include <string>
 using std::string;
-
-#include "client/dbclient.h"
+using std::auto_ptr;

 class MONGODBException {
 public:

It's in https://github.com/azlev/powerdns/commit/a402d8493e5610e139ea19a9ef700e26b2e6e35c

终止放荡 2025-01-15 10:12:21

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

#include<memory>

并更改

auto_ptr<mongo::DBClientCursor> cursor;

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

mangobackend.hh 中的 108/109/110 行周围

它可能对您有用,但我认为它是很大程度上取决于您使用的 mangodb-api。

如果您提供有关您的环境的更多信息(发行版、芒果版本等),将会很有帮助

The compile error you have can be overcome by adding:

#include<memory>

and changing

auto_ptr<mongo::DBClientCursor> cursor;

to

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

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文