華為云計算 云知識 fmt是什么
fmt是什么

簡介

fmt是一個用于C++的開源格式庫。 它可以作為printf和iostreams的安全和快速替代品。

編譯和測試方式

1.配置編譯環(huán)境

1)安裝wget工具。

yum install wget -y

2)安裝或者升級cmake版本到3.1.0或更高版本。

cd /usr/local/src

yum remove cmake cmake-data

wget https://cmake.org/files/v3.9/cmake-3.9.2.tar.gz

tar -zxvf cmake-3.9.2.tar.gz

cd cmake-3.9.2

./configure

make && make install

----結束

2.獲取源碼

獲取“fmt-6.0.0”源碼包。

cd /usr/local/src

wget https://github.com/fmtlib/fmt/archive/6.0.0.tar.gz

3.編譯和安裝

1)解壓軟件包。

cd /usr/local/src

tar -zxvf 6.0.0.tar.gz

2)進入fmt的安裝目錄。

cd fmt-6.0.0/

3)生成Makefile文件。

mkdir build

cd 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.