mongodb-c-driver构建

龙隐水
2023-12-01

介绍

安装方式可以看官网
http://mongoc.org/libmongoc/current/installing.html

示例

先安装依赖

sudo apt-get install cmake libssl-dev libsasl2-dev
sudo apt-get install libbson-1.0-0

编译构建(从git上)

git clone https://github.com/mongodb/mongo-c-driver.git
cd mongo-c-driver
git checkout 1.20.0 # 构建特定版本
python build/calc_release_version.py > VERSION_CURRENT
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..

执行构建

sudo cmake --build
sudo cmake --build . --target install
 类似资料: