$ bash config_brpc.sh --headers="/path/to/deps/include/" --libs="/path/to/deps/lib/" --with-glog --with-thrift $ make -j ${make_thread_num} $ cp -a output/include/* "/path/to/install/include/" $ cp -a output/lib/* "/path/to/install/lib/" $ cp -a output/bin/* "/path/to/install/lib/"
问题
NO 1
描述
1 2 3 4 5 6
ERROR: something wrong with flag 'flagfile' in file '/home/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags.cc'. One possibility: file '/home/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags.cc' is being linked both statically and dynamically into this executable.
或者
Ignoring RegisterValidateFunction() for flag pointer 0x7f3d0b54893c: no flag found at that address ...
DEFINE_bool(big_menu, true, "Include 'advanced' options in the menu listing"); DEFINE_string(languages, "english,french,german", "comma-separated list of languages to offer in the 'lang' menu");
// 方法调用 if (FLAGS_languages.find("finnish") != string::npos) { // do something }
声明检查
1 2 3 4 5 6 7 8
staticboolValidatePort(constchar* flagname, int32 value){ if (value > 0 && value < 32768) // value is ok returntrue; printf("Invalid value for --%s: %d\n", flagname, (int)value); returnfalse; } DEFINE_int32(port, 0, "What port to listen on"); DEFINE_validator(port, &ValidatePort);
DECLARE_bool(lib_verbose); // mylib has a lib_verbose flag, default is false intmain(int argc, char** argv){ FLAGS_lib_verbose = true; // in my app, I want a verbose lib by default ParseCommandLineFlags(...); }
#define STRIP_FLAG_HELP 1 // this must go before the #include! #include<gflags/gflags.h>
问题
NO 1
描述
1
ERROR: something wrong with flag 'flagfile' in file '/home/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags.cc'. One possibility: file '/home/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags.cc' is being linked both statically and dynamically into this executable.