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

有什么建议么?

最佳答案

你可以试试这个补丁吗?

差异--git a / modules / mongodbbackend / mongodbbackend.hh b / modules / mongodbbackend / mongodbbackend.hh
索引816128f..4f7cf78 100644
--- a /模块/mongodbbackend/mongodbbackend.hh
+++ b / modules / mongodbbackend / mongodbbackend.hh
@@ -1,13 +1,13 @@
#ifndef MONGODB_HH
#定义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

10-02 09:24