我正在尝试构建mongo-cxx-驱动程序库。
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
得到上面的错误。
下面是违规代码(第#行添加了更少的代码):
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这段代码在我看来没问题。有人能指出我错过了什么吗?其中是否存在上游问题?怎么才能找到它呢?
干杯
发布于 2016-03-16 19:03:15
看来您使用的是主分支中的libmongoc,它似乎有一个错误,其中该BSON_END_DECLS与上面的BEGIN_DECLS不成对(它在以前的提交中被意外地删除了)
我在:https://jira.mongodb.org/browse/CDRIVER-1162上输入了一个bug
1.3.4标记是一个实际的稳定版本,似乎没有相同的问题。
https://stackoverflow.com/questions/35348231
复制相似问题