Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sherlock-wong opened this issue Apr 11, 2024 · 5 comments
Open

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

sherlock-wong opened this issue Apr 11, 2024 · 5 comments

Comments

@sherlock-wong
Copy link

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

@chenBright
Copy link
Contributor

加上namespace logging试试:

namespace logging {
DECLARE_int32(v);
}

@sherlock-wong
Copy link
Author

加上namespace logging试试:

namespace logging {
DECLARE_int32(v);
}

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

@chenBright
Copy link
Contributor

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

@sherlock-wong
Copy link
Author

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

@chenBright
Copy link
Contributor

那现在是什么问题?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants