powerdns + mongodb
powerdns + mongodb
我试图编译powerdns的mongodbendend模块,但遇到了这个问题:
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驱动程序),这将非常有用。
你能试试这个补丁吗?
diff—git a/modules/mongodbbackend/mongodbackend.hh b/modules/mongodbackend/mongobbackend.hh索引816128f。。4f7cf78 100644---a/modules/megodbackend/mongodbackend.hh+++b/modules/megodbackend/mongodbackend.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
可以通过添加来克服编译错误
#include<memory>
和更改
auto_ptr<mongo::DBClientCursor> cursor;
至
std::auto_ptr<mongo::DBClientCursor> cursor;
mangobackend.hh
中108/109/110线附近
它可能对您有效,但我认为这在很大程度上取决于您使用的mangodbapi。
如果您提供更多关于您的环境(发行版、mango版本等)的信息,
- Mongodb c++驱动程序:如何查询元素的数组
- Mongocxx无法使用SSL连接到mongoDB
- 获取 OID(类型::b_oid)作为 MongoDB C++驱动程序中的字符串
- MongoDB 使用数组中的 OR 条件构建查询
- 使用 C++ 查询 MongoDB 的日期字符串
- MongoDB C++ 驱动程序 - 8 位和 16 位整数?
- 无法使用C++代码向MongoDB进行身份验证
- 将 MongoDB C++ 驱动程序升级到 mongocxx-3.1.2
- Mongodb C驱动程序在Windows上安装失败
- 修改Mongodb源代码以禁用文档的自动生成"_id"字段
- Mongodb C++编译问题
- Mongodb Cxx 驱动程序测试在发布版本中崩溃 [ 在调试中工作正常]
- 在 mongodb c++ 驱动程序中使用声明"not found"
- 将mongocxx连接到mongodb服务器时出错:SSL支持不可用
- MongoDB C 查询文档的子元素
- 编译MongoDB C 11驱动程序的错误
- C++ MongoDB 客户端作为类成员
- 无法从C++代码连接到MongoDB
- 如何在C++中使用MongoDB GeoSpatial Index
- powerdns + mongodb