apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".

Home Page:https://brpc.apache.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

用brpc的flag v会提示引用找不到

sherlock-wong opened this issue · comments

Describe the bug (描述bug)
在其他的文件中DECLARE_int32(v); 但是用的时候会提示找不到引用,在cmake里已经link了brpc和gflag

To Reproduce (复现方法)

Expected behavior (期望行为)

Versions (各种版本)
OS:
Compiler:
brpc:
protobuf:

Additional context/screenshots (更多上下文/截图)
image

image
image

加上namespace logging试试:

namespace logging {
DECLARE_int32(v);
}

加上namespace logging试试:

namespace logging {
DECLARE_int32(v);
}

多谢你的意见, 不过这种方式也读不到相应的值

读不到命令行的值吗?调用了 gflags::ParseCommandLineFlags(&argc, &argv, true);吗?
详细使用方法参考gflag文档:https://gflags.github.io/gflags/#together

读不到命令行的值吗?调用了 gflags::ParseCommandLineFlags(&argc, &argv, true);吗? 详细使用方法参考gflag文档:https://gflags.github.io/gflags/#together
image
在main函数就已经调用了的

那现在是什么问题?