【发布时间】:2020-09-08 22:43:41
【问题描述】:
我正在尝试在 Windows 上构建 mongo-cxx-driver;我正在关注instructions,但出现错误:
C1189 #error: "Cannot find a valid polyfill for make_unique"
这就是我所做的:
构建 mongo-c-driver
我使用指定的最低版本 (1.15) 克隆了 mongo-c-driver:
git clone https://github.com/mongodb/mongo-c-driver --branch r1.15
使用 CMake-Gui(我使用的是 3.18.2),我使用 Visual Studio 16 2019 Generator 生成了 .proj 文件。我使用了默认设置:
这样构建成功,我可以在C:\Program Files (x86)\mongo-c-driver找到对应的.dll和.lib文件。
构建 mongo-cxx-driver
我使用我想要的版本克隆了项目(与mongo-c-driver的上述版本兼容):
git clone https://github.com/mongodb/mongo-cxx-driver --branch releases/v3.5
我用Cmake-Gui配置了CMake参数,配置了我安装mongo-c的路径:
注意:
- 我没有填写
bson-1.0_DIR或mongoc-1.0_DIR,因为我不知道他们在寻找什么。 - 我设置了
BSONCXX_POLY_USE_STD=1,因为我使用的是C++17,不想使用std::experimental或Boost。
我尝试在 Visual Studio 中编译它,并得到上述关于找不到make_unique 的有效 polyfill 的错误。我哪里做错了?
谢谢!
【问题讨论】:
标签: c++ mongodb cmake mongo-cxx-driver mongo-c-driver