错误信息:
In file included from /usr/bin/mongo-cxx-driver-r3.1.1/src/bsoncxx/json.hpp:21:0,
from /usr/bin/mongo-cxx-driver-r3.1.1/src/bsoncxx/document/element.cpp:24:/usr/bin/mongo-cxx-driver-r3.1.1/src/bsoncxx/stdx/optional.hpp:52:38: error: too many initializers for ‘const nullopt_t {aka const boost::none_t}’
const nullopt_t nullopt{::boost::none};
^
make[2]: *** [src/bsoncxx/CMakeFiles/bsoncxx.dir/document/element.cpp.o] Error 1
make[1]: *** [src/bsoncxx/CMakeFiles/bsoncxx.dir/all] Error 2
make: *** [all] Error 2
解决方案:使用vim打开/usr/bin/mongo-cxx-driver-r3.1.1/src/bsoncxx/stdx/optional.hpp定位到第52行,将const nullopt_t nullopt{::boost::none};修改为const nullopt_t nullopt=::boost::none; 即可。