compile/install C++ driver for MongoDB fail

本文档记录了C++11驱动的安装过程,包括前置条件C驱动的安装,从指定位置下载并解压文件,使用cmake进行编译配置等步骤。遇到的问题主要为cmake和gcc版本过低导致的依赖错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

C++ 11 driver

  • install C driver before your install C++ driver
  • download from here and extract it to your directory
  • compile
$ cd mongo-cxx-driver-r3.1.2/build
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
  • fail for need higher version cmake and gcc, gcc in my env is 4.8, this version is same with the gcc version in here. but my cmake version is 2.8
  • if you want to move on, please update your gcc and cmake to higher version

PS:
I got below error when you install some package, it means, you gcc version is low

# rpm -ivh cmake-3.9.0-2.fc27.x86_64.rpm
error: Failed dependencies:
        cmake-data = 3.9.0-2.fc27 is needed by cmake-3.9.0-2.fc27.x86_64
        cmake-filesystem = 3.9.0-2.fc27 is needed by cmake-3.9.0-2.fc27.x86_64
        libform.so.6()(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        libjsoncpp.so.11()(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        libncurses.so.6()(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        librhash.so.0()(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        libstdc++.so.6(CXXABI_1.3.8)(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        libstdc++.so.6(CXXABI_1.3.9)(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        libstdc++.so.6(GLIBCXX_3.4.20)(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        libstdc++.so.6(GLIBCXX_3.4.21)(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        libtinfo.so.6()(64bit) is needed by cmake-3.9.0-2.fc27.x86_64
        libuv.so.1()(64bit) is needed by cmake-3.9.0-2.fc27.x86_64

My question is that: does there have any page can explain which gcc version map to CXXABI version

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值