首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >c++定义指令失败,代码看起来正常

c++定义指令失败,代码看起来正常
EN

Stack Overflow用户
提问于 2016-02-11 19:22:56
回答 1查看 146关注 0票数 1

我正在尝试构建mongo-cxx-驱动程序库。

代码语言:javascript
复制
mmuratet@fisher:~/mongo-cxx-driver/build$ cmake --prefix=/usr/local ..
-- No build type selected, default is Release
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mmuratet/mongo-cxx-driver/build

mmuratet@fisher:~/mongo-cxx-driver/build$ make
[  3%] Built target EP_mnmlstc_core
[ 10%] Built target bsoncxx
[ 16%] Built target bsoncxx_static
[ 21%] Built target test_bson
[ 22%] Building CXX object src/mongocxx/CMakeFiles/mongocxx.dir/bulk_write.cpp.o
In file included from /usr/local/include/libbson-1.0/bson-compat.h:38:0,
             from /usr/local/include/libbson-1.0/bson.h:23,
             from /home/mmuratet/mongo-cxx-driver/src/mongocxx/private/libbson.hpp:17,
             from /home/mmuratet/mongo-cxx-driver/src/mongocxx/bulk_write.cpp:18:
/usr/local/include/libbson-1.0/bson-macros.h:48:28: error: expected declaration before ‘}’ token
 #  define BSON_END_DECLS   }
                        ^
/usr/local/include/libmongoc-1.0/mongoc-stream-tls-private.h:61:1: note: in expansion of macro ‘BSON_END_DECLS’
 BSON_END_DECLS

^ make2:* 错误1 make1:* src/mongocxx/CMakeFiles/mongocxx.dir/all Error 2作出:*所有错误2

得到上面的错误。

下面是违规代码(第#行添加了更少的代码):

代码语言:javascript
复制
 46 #ifdef __cplusplus
 47 #  define BSON_BEGIN_DECLS extern "C" {
 48 #  define BSON_END_DECLS   }
 49 #else
 50 #  define BSON_BEGIN_DECLS
 51 #  define BSON_END_DECLS
 52 #endif

这段代码在我看来没问题。有人能指出我错过了什么吗?其中是否存在上游问题?怎么才能找到它呢?

干杯

EN

回答 1

Stack Overflow用户

发布于 2016-03-16 19:03:15

看来您使用的是主分支中的libmongoc,它似乎有一个错误,其中该BSON_END_DECLS与上面的BEGIN_DECLS不成对(它在以前的提交中被意外地删除了)

我在:https://jira.mongodb.org/browse/CDRIVER-1162上输入了一个bug

1.3.4标记是一个实际的稳定版本,似乎没有相同的问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35348231

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档