supernear opened a new issue, #2371:
URL: https://github.com/apache/brpc/issues/2371

   **Describe the bug (描述bug)**
   [ 94%] Linking CXX executable ../output/bin/protoc-gen-mcpack
   ../output/lib/libbrpc.a(logging.cc.o): In function 
`__static_initialization_and_destruction_0':
   /home/opensource/brpc/src/butil/logging.cc:127: undefined reference to 
`google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, 
char const*, std::string*, std::string*)'
   /home/opensource/brpc/src/butil/logging.cc:1595: undefined reference to 
`google::RegisterFlagValidator(std::string const*, bool (*)(char const*, 
std::string const&))'
   ../output/lib/libbrpc.a(variable.cpp.o): In function 
`bvar::dumping_thread(void*)':
   /home/opensource/brpc/src/bvar/variable.cpp:743: undefined reference to 
`google::GetCommandLineOption(char const*, std::string*)'
   /home/opensource/brpc/src/bvar/variable.cpp:747: undefined reference to 
`google::GetCommandLineOption(char const*, std::string*)'
   /home/opensource/brpc/src/bvar/variable.cpp:752: undefined reference to 
`google::GetCommandLineOption(char const*, std::string*)'
   /home/opensource/brpc/src/bvar/variable.cpp:757: undefined reference to 
`google::GetCommandLineOption(char const*, std::string*)'
   /home/opensource/brpc/src/bvar/variable.cpp:761: undefined reference to 
`google::GetCommandLineOption(char const*, std::string*)'
   
../output/lib/libbrpc.a(variable.cpp.o):/home/opensource/brpc/src/bvar/variable.cpp:767:
 more undefined references to `google::GetCommandLineOption(char const*, 
std::string*)' follow
   ../output/lib/libbrpc.a(variable.cpp.o): In function 
`__static_initialization_and_destruction_0':
   /home/opensource/brpc/src/bvar/variable.cpp:700: undefined reference to 
`google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, 
char const*, std::string*, std::string*)'
   /home/opensource/brpc/src/bvar/variable.cpp:701: undefined reference to 
`google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, 
char const*, std::string*, std::string*)'
   /home/opensource/brpc/src/bvar/variable.cpp:703: undefined reference to 
`google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, 
char const*, std::string*, std::string*)'
   /home/opensource/brpc/src/bvar/variable.cpp:705: undefined reference to 
`google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, 
char const*, std::string*, std::string*)'
   /home/opensource/brpc/src/bvar/variable.cpp:706: undefined reference to 
`google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, 
char const*, std::string*, std::string*)'
   
../output/lib/libbrpc.a(variable.cpp.o):/home/opensource/brpc/src/bvar/variable.cpp:716:
 more undefined references to 
`google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, 
char const*, std::string*, std::string*)' follow
   ../output/lib/libbrpc.a(variable.cpp.o): In function 
`__static_initialization_and_destruction_0':
   /home/opensource/brpc/src/bvar/variable.cpp:912: undefined reference to 
`google::RegisterFlagValidator(std::string const*, bool (*)(char const*, 
std::string const&))'
   /home/opensource/brpc/src/bvar/variable.cpp:914: undefined reference to 
`google::RegisterFlagValidator(std::string const*, bool (*)(char const*, 
std::string const&))'
   /home/opensource/brpc/src/bvar/variable.cpp:916: undefined reference to 
`google::RegisterFlagValidator(std::string const*, bool (*)(char const*, 
std::string const&))'
   /home/opensource/brpc/src/bvar/variable.cpp:918: undefined reference to 
`google::RegisterFlagValidator(std::string const*, bool (*)(char const*, 
std::string const&))'
   /home/opensource/brpc/src/bvar/variable.cpp:920: undefined reference to 
`google::RegisterFlagValidator(std::string const*, bool (*)(char const*, 
std::string const&))'
   
../output/lib/libbrpc.a(variable.cpp.o):/home/opensource/brpc/src/bvar/variable.cpp:925:
 more undefined references to `google::RegisterFlagValidator(std::string 
const*, bool (*)(char const*, std::string const&))' follow
   ../output/lib/libbrpc.a(gflag.cpp.o): In function `bvar::GFlag::get_value() 
const':
   /home/opensource/brpc/src/bvar/gflag.cpp:81: undefined reference to 
`google::GetCommandLineOption(char const*, std::string*)'
   ../output/lib/libbrpc.a(gflag.cpp.o): In function 
`bvar::GFlag::set_value(char const*)':
   /home/opensource/brpc/src/bvar/gflag.cpp:88: undefined reference to 
`google::SetCommandLineOption(char const*, char const*)'
   collect2: error: ld returned 1 exit status
   make[2]: *** [output/bin/protoc-gen-mcpack] Error 1
   make[1]: *** [src/CMakeFiles/protoc-gen-mcpack.dir/all] Error 2
   make: *** [all] Error 2
   
   
   
   
   **To Reproduce (复现方法)**
   mkdir -p build
   cd build
   cmake ../
   
   /usr/lib/libgflags.a
   /usr/lib64/libgflags.a
   /usr/local/lib/libgflags.a
   /usr/lib64/libgflags.so
   /usr/local/lib/libgflags.so
   /home/tools/gflags-v2.2.2/build/lib/libgflags.so
   
   /usr/lib/libglog.a
   /usr/lib64/libglog.a
   /usr/local/lib/libglog.a
   /usr/local/lib64/libglog.a
   /home/tools/glog/build/libglog.a
   /usr/lib64/libglog.so
   /usr/local/lib/libglog.so
   /usr/local/lib64/libglog.so
   /home/tools/glog/build/libglog.so
   
   **Expected behavior (期望行为)**
   可以正常编译通过
   
   **Versions (各种版本)**
   OS:CentOS Linux release 7.9.2009 (Core)
   Compiler:g++ (GCC) 8.3.0 gcc (GCC) 8.3.0
   brpc: brpc.1.6.0
   protobuf: libprotoc 2.5.0
   
   **Additional context/screenshots (更多上下文/截图)**
   
![微信图片_20230906104653](https://github.com/apache/brpc/assets/139832811/fdb42640-317e-4dc1-bcf4-f2eaf6a29f30)
   
   


-- 
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-unsubscr...@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to