c++ yaml-cpp 安装

 

环境:
Ubuntu14.04


下载cmake(我使用的是3.1.0)
https://cmake.org/files/v3.1/

tar -xvf cmake-3.1.0-Linux-x86_64.tar.gz
sudo mv cmake-3.1.0-Linux-x86_64 /opt/cmake-3.1.0
sudo ln -sf /opt/cmake-3.1.0/bin/* /usr/bin/
cmake --version


下载 yaml-cpp-yaml-cpp-0.6.0.zip
https://github.com/jbeder/yaml-cpp/releases/tag/release-0.6.0
或者
https://github.com/jbeder/yaml-cpp/tags

cd yaml-cpp-yaml-cpp-0.6.0/
mkdir build && cd build

#生成动态库
cmake ..  -DBUILD_SHARED_LIBS=ON
#生成静态库
cmake ..

make

mkdir /home/k/Desktop/output
make DESTDIR=/home/k/Desktop/output install

库文件生成到了output文件夹。

 

posted @ 2019-06-29 15:39  anobscureretreat  阅读(1903)  评论(0编辑  收藏  举报