sunzhenkai edited a comment on issue #1199: URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-755299530
 gflags静态库和共享库同时存在导致。我是选择手动编译gflags,在编译时为cmake指定`-DBUILD_SHARED_LIBS=1`只编译共享库,可解决问题,具体参考[这里](https://github.com/sunzhenkai/cooking/blob/5022774c0185cf140c90553d837fc247f9586d67/c%2B%2B/universal/third/install.sh#L73)。如果是使用命令安装,可以尝试先移除`/usr/local/lib/libgflag.a` 和 `/usr/local/lib/libgflag_nothread.a`,然后重新编译brpc,可解决问题。  如果遇到下面这个异常,类似的原因,移除静态库。 ``` ERROR: something wrong with flag 'help' in file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc'. One possibility: file '/Users/wii/Git/cooking/c++/universal/third/build/gflags-2.2.2/src/gflags_reporting.cc' is being linked both statically and dynamically into this executable. ``` 以上仅供参考。 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
