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/09/03 07:54:18 UTC

[GitHub] [incubator-brpc] TousakaRin commented on issue #1498: Cannot build example programs when following the build instruction on Arch Linux

TousakaRin commented on issue #1498:
URL: https://github.com/apache/incubator-brpc/issues/1498#issuecomment-912336616


   I reproduced this problem through the image you provided,
   
   The root cause of the problem is like this:
   1.  you enabled --with-glog when you run config_brpc.sh, so glog will be linked, and the script only found a dynamic library(libglog.so), so glog will be dynamic linked. Similarly, gflag will be linked in a static way
   2. gflag is referenced by glog,  and libglog.so linked gflags in dynamic way, it is reasonable.
   3. in some platform, gflags.a is packed without option '-fPIC', and it is the default behavior when compiling gflag, so when you link ./example/echo_c++/echo_server with **libgflags.a and libglog.so**,  error occured.
   
   in some other platform , even if they are packaging static libraries, they will add options '-fPIC', for example Ubuntu. to solve this promble, compile gflags with source code, and set CPPFLAGS=-fPIC, then everything works fine.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

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