当前位置: 首页 > 知识库问答 >
问题:

ubuntu 16.04中安装MongoDB C++驱动程序的问题

丰智
2023-03-14

我想安装MongoDB C++驱动程序,所以首先是mongocxx

我遵循以下安装:http://mongocxx.org/mongocxx-v3/installation/但无法通过步骤4

当我在mongo-cxx-driver/build中运行它时

sudo cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
-- Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
CMake Error at src/mongocxx/CMakeLists.txt:37 (find_package):
  By not providing "Findlibmongoc-1.0.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "libmongoc-1.0", but CMake did not find one.

  Could not find a package configuration file provided by "libmongoc-1.0"
  (requested version 1.13.0) with any of the following names:
[![enter image description here][1]][1]
    libmongoc-1.0Config.cmake
    libmongoc-1.0-config.cmake

  Add the installation prefix of "libmongoc-1.0" to CMAKE_PREFIX_PATH or set
  "libmongoc-1.0_DIR" to a directory containing one of the above files.  If
  "libmongoc-1.0" provides a separate development package or SDK, be sure it
  has been installed.

有没有人能帮帮我,我已经困在这里很久了?

我的环境:mongo-c-driver 1.15.1 libmongoC-1.0mongoCxx-3.4.x

共有1个答案

章远航
2023-03-14

Cmake正在抱怨找不到包配置文件(xxx.Cmake),可能是因为您没有构建libmongoc/libbson。

我试图重现您的问题,并且在我只安装它们(apt-get install)时遇到了相同的问题,因此我的建议是您获取源代码并按照以下网址构建它们:http://mongoc.org/libmongoc/current/installing.html

下面是我刚试过的命令列表(带有mongo-c-driver=1.15.1),效果很好:

wget https://github.com/mongodb/mongo-c-driver/releases/download/1.15.1/mongo-c-driver-1.15.1.tar.gz
tar xzf mongo-c-driver-1.15.1.tar.gz
cd mongo-c-driver-1.15.1
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
make
sudo make install

此时,您可以返回到mongocxx/build并再次运行您被困在的命令:

cd ../../mongo-cxx-driver/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
 类似资料:
  • 本文向大家介绍详解Ubuntu16.04安装nvidia驱动+CUDA+cuDNN的教程,包括了详解Ubuntu16.04安装nvidia驱动+CUDA+cuDNN的教程的使用技巧和注意事项,需要的朋友参考一下 准备工作 1.查看GPU是否支持CUDA lspci | grep -i nvidia 2.查看Linux版本 uname -m && cat /etc/*release nvidia驱动

  • 本文向大家介绍Ubuntu16.04安装MySQL5.7的教程,包括了Ubuntu16.04安装MySQL5.7的教程的使用技巧和注意事项,需要的朋友参考一下 安装主程序 主程序安装就我知道有两种方式: - 使用apt-get全自动安装 使用dpkg手动安装依赖包 至此,我们已经完成了主程序安装,并可以在本机使用MySQL -u root -p进行登录数据库了。 开放远程访问 开启root用户的全

  • 问题内容: 我很难确定应该如何在我的debian 6.0服务器上为PostgreSQL安装JDBC驱动程序。我已将驱动程序.jar移至以下目录: 然后,教程讨论如何使用此代码: 但是,由于我是PostgreSQL的新手,所以我不知道应该把这行放在哪里,或者这是否正确。 我的问题是,除了将jar文件移动到此位置之外,为了在我的postgreSQL安装上安装JDBC驱动程序,我实际上需要做什么? 编辑

  • 本文向大家介绍Ubuntu16.04手动安装MongoDB的详细教程,包括了Ubuntu16.04手动安装MongoDB的详细教程的使用技巧和注意事项,需要的朋友参考一下 我最近在研究MongoDB的路上,那么今天也算个学习笔记吧!今天用Ubuntu16.04手动安装MongoDB,分享给大家 注意事项: 仔细按步骤阅读操作 注意别写错字 牢记上面两点 一、用自带的火狐浏览器下载Ubuntu 16

  • 我已经从http://dev.MySQL.com/downloads/connector/j/下载了MySQL“mysql-connector-java-gpl-5.1.26.msi”的JDBC驱动程序。但我想不出怎么用。http://dev.mysql.com/doc/refman/5.6/en/connector-j-binary-installation.html上的文档说明它是一个zip文

  • 在Eclipse BIRT数据资源管理器中为查询生成器添加JDBC数据库连接: 选择“查询生成器的JDBC数据库连接” 就这样。我可以使用此数据源来使用数据集。 下一个。 我希望使用更灵活的“JDBC数据源”,而不是以前成功使用的“查询生成器的JDBC数据库连接”。哦,我看到MySQL没有驱动程序类-Derby和Sample只有两个默认条目。 似乎JDBC驱动程序的有效注册没有添加(或注册?)司机