Some Notes of gflags

1. gflags的官方简介:http://gflags.github.io/gflags/  

    gflags的中文简介:http://blog.csdn.net/lezardfu/article/details/23753741

2. gflags的下载地址:http://https://github.com/gflags/gflags

3. 下载下来之后,安装时参考github上的安装说明:https://github.com/gflags/gflags/blob/master/INSTALL.md

4. 要写一个Example,可参考:http://www.cnblogs.com/tianyajuanke/p/3467572.html

5. 编译的时候,假设源文件为main.cpp,在源文件所在目录下输入一下命令编译:

#g++ main.cpp -lgflags -lpthread
6. 如果是按照第4步写的例子,运行Example的时候,假设输出为a.out,则输入
#a.out -ip="192.168.1.1" -port="8080" -isvip="true"
将输出:
ip: 192.168.1.2
port: 8080
isvip: 1

你可能感兴趣的:(C++,gflags)