码迷,mamicode.com
首页 > 编程语言 > 详细

c++ fmt 库安装和使用示例

时间:2018-06-30 11:01:37      阅读:1938      评论:0      收藏:0      [点我收藏+]

标签:c++   line   链接库   format   文件   cmak   for   color   ios   

安装:
1 git clone  https://github.com/fmtlib/fmt.git
2. cmake .
3. make && make install 
#include "fmt/format.h"
#include <iostream>
int main()
{
        std::string s = fmt::format("{0}is{1}", "abra",12);
        std::cout << s <<std::endl;
        return 0;
}
编译选项要使用 -std=c++11  -lfmt 以及指定链接库和头文件位置  

c++ fmt 库安装和使用示例

标签:c++   line   链接库   format   文件   cmak   for   color   ios   

原文地址:https://www.cnblogs.com/qianlicao/p/9245973.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!