brpc icon indicating copy to clipboard operation
brpc copied to clipboard

编译安装使用问题

Open jiapengwen opened this issue 8 years ago • 9 comments

Describe the bug (描述bug) 在centos上按照编译步骤,cmake 是有问题的,原因是 yum安装的gflags,protobuf等版本太旧,导致头文件不一致,所以cmake .. 这步是 通过不了的 To Reproduce (复现方法) https://github.com/brpc/brpc/blob/master/docs/cn/getting_started.md centos 下,按照步骤 Expected behavior (期望行为) 提供源码安装步骤

Versions (各种版本) OS:centos7 Compiler:gcc4.8.2 brpc: protobuf:

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

jiapengwen avatar Oct 26 '18 09:10 jiapengwen

This issue has been automatically marked as stale because it's inactive for a long time. It will be closed if no further activity occurs, reopen if you have further ideas. Thank you for your contributions! 由于很久没有活跃,此Issue已被自动标记为过期。之后几天仍无变化的话将会被关闭,若你有新想法则可重新打开。感谢你的贡献!

stale[bot] avatar Nov 25 '18 10:11 stale[bot]

yum和apt的源都比较老了,而下载最新的protobuf源码编译之后会出现protobuf版本太新的问题,主要是GOOGLE_PROTOBUF_DECLARE_ONCE在最新的protobuf git仓库中已经使用std::call_once代替了。

disillusion028 avatar Nov 27 '18 02:11 disillusion028

@jiapengwen 我使用的是Ubuntu,我发现使用config_brpc.sh编译会报错,但是如果使用cmake编译是没问题的。不知道能否解决你的问题

liucong-roadstar avatar Dec 09 '18 06:12 liucong-roadstar

This issue has been automatically marked as stale because it's inactive for a long time. It will be closed if no further activity occurs, reopen if you have further ideas. Thank you for your contributions! 由于很久没有活跃,此Issue已被自动标记为过期。之后几天仍无变化的话将会被关闭,若你有新想法则可重新打开。感谢你的贡献!

stale[bot] avatar Jan 08 '19 06:01 stale[bot]

执行make时,报如下错误。 <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1387:50: 附注:in expansion of macro ‘GFLAGS_NS’ const bool ALLOW_UNUSED validate_vmodule_dummy = GFLAGS_NS::RegisterFlagValidator( ^ <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1417:44: 附注:in expansion of macro ‘GFLAGS_NS’ const bool ALLOW_UNUSED validate_v_dummy = GFLAGS_NS::RegisterFlagValidator( ^ <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1425:5: 附注:in expansion of macro ‘GFLAGS_NS’ GFLAGS_NS::RegisterFlagValidator(&FLAGS_crash_on_fatal_log, PassValidate); ^ <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1428:5: 附注:in expansion of macro ‘GFLAGS_NS’ GFLAGS_NS::RegisterFlagValidator(&FLAGS_print_stack_on_check, PassValidate); ^ <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1434:50: 附注:in expansion of macro ‘GFLAGS_NS’ const bool ALLOW_UNUSED validate_min_log_level = GFLAGS_NS::RegisterFlagValidator( ^ make: *** [src/butil/logging.o] 错误 1

mengrenfeixiang avatar Feb 21 '19 02:02 mengrenfeixiang

执行make时,报如下错误。 <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1387:50: 附注:in expansion of macro ‘GFLAGS_NS’ const bool ALLOW_UNUSED validate_vmodule_dummy = GFLAGS_NS::RegisterFlagValidator( ^ <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1417:44: 附注:in expansion of macro ‘GFLAGS_NS’ const bool ALLOW_UNUSED validate_v_dummy = GFLAGS_NS::RegisterFlagValidator( ^ <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1425:5: 附注:in expansion of macro ‘GFLAGS_NS’ GFLAGS_NS::RegisterFlagValidator(&FLAGS_crash_on_fatal_log, PassValidate); ^ <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1428:5: 附注:in expansion of macro ‘GFLAGS_NS’ GFLAGS_NS::RegisterFlagValidator(&FLAGS_print_stack_on_check, PassValidate); ^ <命令行>:0:11: 错误:‘gflags’未声明 src/butil/logging.cc:1434:50: 附注:in expansion of macro ‘GFLAGS_NS’ const bool ALLOW_UNUSED validate_min_log_level = GFLAGS_NS::RegisterFlagValidator( ^ make: *** [src/butil/logging.o] 错误 1

请问这个问题有解决吗? 我使用config_brpc.sh编译也遇到了同样的问题

hexiecs avatar Nov 11 '19 09:11 hexiecs

建议你看下 gflag 怎么使用的

jiapengwen avatar Nov 11 '19 09:11 jiapengwen

建议你看下 gflag 怎么使用的

这是个编译问题,跟使用有关吗?你最后是怎么解决的?

hexiecs avatar Nov 11 '19 10:11 hexiecs

我后来是安装新版本的依赖解决的

jiapengwen avatar Nov 11 '19 10:11 jiapengwen