簡介
fmt是一個用于C++的開源格式庫。 它可以作為printf和iostreams的安全和快速替代品。
編譯和測試方式
1.配置編譯環(huán)境
1)安裝wget工具。
yum install wget -y
2)安裝或者升級cmake版本到3.1.0或更高版本。
cd /usr/local/srcyum remove cmake cmake-datawget https://cmake.org/files/v3.9/cmake-3.9.2.tar.gztar -zxvf cmake-3.9.2.tar.gzcd cmake-3.9.2./configuremake && make install
----結束
2.獲取源碼
獲取“fmt-6.0.0”源碼包。
cd /usr/local/srcwget https://github.com/fmtlib/fmt/archive/6.0.0.tar.gz
3.編譯和安裝
1)解壓軟件包。
cd /usr/local/srctar -zxvf 6.0.0.tar.gz
2)進入fmt的安裝目錄。
cd fmt-6.0.0/
3)生成Makefile文件。
mkdir buildcd build/cmake ..
4)安裝fmt。
make && make install
----結束
4.運行和驗證
查詢fmt版本號。
fmt --version
回顯信息如下,則表示fmt安裝成功。
fmt (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redis tribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ross Paterson.