zengkui opened a new issue, #1794:
URL: https://github.com/apache/incubator-brpc/issues/1794
**Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**
当应用程序使用到brpc并且想修改brpc中的一些flag的default value的时候编译会有问题,示列如下:
```cpp
DECLARE_bool(bvar_dump);
int main(int argc, char** argv) {
FLAGS_bvar_dump = true; // 此处编译会报错 undefined reference to
fLB::FLAGS_bvar_dump
gflags::ParseCommandLineFlags(&argc, &argv, true);
}
```
**Describe the solution you'd like (描述你期望的解决方法)**
原因是flags defined in bvar namespace。如果能挪到 global namespace 那就没有问题。
虽然可以通过设置flag的方式来正常使用,但同时也希望应用程序中能有修改的default value的办法。
另外查看了gflags的文档,其中也指出flags的变量应该是需要定义在global namespace的
> DEFINE_foo (and DECLARE_foo,
[below](https://gflags.github.io/gflags/#declare)), should always be in the
global namespace.
**Describe alternatives you've considered (描述你想到的折衷方案)**
**Additional context/screenshots (更多上下文/截图)**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]