你好我在Windows 10中使用Qt creator 4.6.0和MongoDB 4.0,我已经安装了mongo-cxx-dirver-r3.3.0(mongodb的c++ drivers) . 问题是,
#include <mongocxx/client.hpp>
#include <mongocxx/instance.hpp>
每当我包含此文件进行连接时 . 但它给出了错误,
错误:C1083:无法打开包含文件:'bsoncxx / config / config.hpp':没有这样的文件或目录 . (包含.hpp config.hpp) .
但每当我检查驱动程序目录时,没有config.hpp文件,但我找到了config.hpp.in .
1 回答
您需要先构建并安装驱动程序,然后才能使用它,而不仅仅是解压缩存档并尝试使用这些文件 .
config.hpp.in
文件是在构建时从中创建config.h
文件的模板 . 请阅读安装说明:https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/installation/