c++ - CPP MongoDB 驱动程序
问题描述
嗨,我一直在尝试使用 MongoDB CPP 驱动程序,但由于某种原因,它会产生很多错误,并且仅在我需要它的特定项目中,例如在新项目中它以某种方式工作并且完全符合要求。
我已经使用 vcpkg 下载了 mongocxx 驱动程序:
cmd> vcpkg install mongo-cxx-driver[boost]:x64-windows
cmd> vcpkg integrate install
Severity Code Description Project File Line Suppression State
Error C2039 'count': is not a member of 'mongocxx::mongocxx::v_noabi::options' MongoDB-Exampels C:\vcpkg\installed\x86-windows\include\mongocxx\collection.hpp 482
Severity Code Description Project File Line Suppression State
Error C2039 'bulk_write': is not a member of 'mongocxx::mongocxx::v_noabi::result' MongoDB-Exampels C:\vcpkg\installed\x86-windows\include\mongocxx\collection.hpp 257
Severity Code Description Project File Line Suppression State
Error C2433 'mongocxx::mongocxx::v_noabi::transaction': 'friend' not permitted on data declarations MongoDB-Exampels C:\vcpkg\installed\x86-windows\include\mongocxx\read_concern.hpp 151
Severity Code Description Project File Line Suppression State
Error C2039 'aggregate': is not a member of 'mongocxx::mongocxx::v_noabi::options' MongoDB-Exampels C:\vcpkg\installed\x86-windows\include\mongocxx\collection.hpp 148
以及很多缺失的错误;或)但是当我查找该行时,它似乎并不是真正的问题......
解决方案
我已经找到了问题的解决方案,我试图在 mt 服务器中实现这个 mongodb api,所以我使用了 winsock2 库作为套接字,显然错误是在加载 mongodb 库之前加载了 winsock2 引起的。
推荐阅读
- javascript - 简化表格分页ajax php mysql
- python-3.x - python web scraping:如何读取 Twitter 类名或 IDS 或 DIV.name ......或任何标识符
- javascript - 根据课程的可用性添加和删除课程
- c++ - 如何将二维数组初始为0
- android - Flutter Checking 以编程方式启用 USB 调试
- git - 如果提交包含超过 200kb 的文件,则其中一个用户无法推送到 gitlab
- wordpress - 需要在 Woocommerce 中将多个特定产品的电子邮件通知发送到包含订单号的不同电子邮件
- android - 房间在Android中获取下一行(项目)
- react-native - 在 react-native-chart-kit 中绘制零星数据
- tcl - 如何使控件“上一个”和“下一个”移动缩放小部件滑块?