test.cpp
#include <stdio.h>
#include <iostream>
#include "gflags/gflags.h"
DEFINE_string(solver, "",
"The solver definition protocol buffer text file.");
main(int argc, char** argv)
{
gflags::ParseCommandLineFlags(&argc, &argv, true);
printf("hello\n");
std::cout << FLAGS_solver << std::endl;
return 0;
}
需要先安装gflags库,再编译:g++ test.cpp -lgflags