You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2021/01/06 13:36:11 UTC

[GitHub] [incubator-brpc] sunzhenkai edited a comment on issue #1199: 动态运行错误RegisterValidateFunction

sunzhenkai edited a comment on issue #1199:
URL: https://github.com/apache/incubator-brpc/issues/1199#issuecomment-755299530


   ![image](https://user-images.githubusercontent.com/74759149/103773476-0f638a00-5066-11eb-9f34-1fa9ad1def7c.png)
   
   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,可解决问题。
   ![image](https://user-images.githubusercontent.com/74759149/103773612-4cc81780-5066-11eb-99f5-3ab1fa69dcfc.png)
   
   
   如果遇到下面这个异常,类似的原因,移除静态库。
   ```
   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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org