You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@brpc.apache.org by "Searion (via GitHub)" <gi...@apache.org> on 2026/01/27 10:08:39 UTC

[I] Ubuntu 22.04 编译报错,修改CMakeLists后成功 (brpc)

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

   **Describe the bug**
   
   [95/336] Building CXX object src/CMakeFiles/SOURCES_LIB.dir/brpc/builtin/vlog_service.cpp.o
   FAILED: src/CMakeFiles/SOURCES_LIB.dir/brpc/builtin/vlog_service.cpp.o  -I/home/buildarea/brpc-1.14.1-src/src -I. -I/home/include -Isrc -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -msse4 -msse4.2 -Wno-aligned-new -DNDEBUG -std=gnu++11 -MD -MT src/CMakeFiles/SOURCES_LIB.dir/brpc/builtin/vlog_service.cpp.o -MF src/CMakeFiles/SOURCES_LIB.dir/brpc/builtin/vlog_service.cpp.o.d -o src/CMakeFiles/SOURCES_LIB.dir/brpc/builtin/vlog_service.cpp.o -c /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:29:44: error: expected class-name before '{' token
      29 | class VLogPrinter : public VLogSitePrinter {
         |                                            ^
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:34:22: error: 'VLogSitePrinter' does not name a type; did you mean 'VLogPrinter'?
      34 |     void print(const VLogSitePrinter::Site& site) {
         |                      ^~~~~~~~~~~~~~~
         |                      VLogPrinter
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:34:43: error: expected unqualified-id before '&' token
      34 |     void print(const VLogSitePrinter::Site& site) {
         |                                           ^
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:34:43: error: expected ')' before '&' token
      34 |     void print(const VLogSitePrinter::Site& site) {
         |               ~                           ^
         |                                           )
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:34:43: error: expected ';' at end of member declaration
      34 |     void print(const VLogSitePrinter::Site& site) {
         |                                           ^
         |                                            ;
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:34:45: error: 'site' does not name a type
      34 |     void print(const VLogSitePrinter::Site& site) {
         |                                             ^~~~
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:64:6: error: 'VLogService' has not been declared
      64 | void VLogService::default_method(::google::protobuf::RpcController* cntl_base,
         |      ^~~~~~~~~~~
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:65:48: error: 'VLogRequest' in namespace 'brpc' does not name a type
      65 |                                  const ::brpc::VLogRequest*,
         |                                                ^~~~~~~~~~~
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:66:42: error: 'brpc::VLogResponse' has not been declared
      66 |                                  ::brpc::VLogResponse*,
         |                                          ^~~~~~~~~~~~
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp: In function 'void brpc::default_method(google::protobuf::RpcController*, const int*, int*, google::protobuf::Closure*)':
   /home/buildarea/brpc-1.14.1-src/src/brpc/builtin/vlog_service.cpp:85:5: error: 'print_vlog_sites' was not declared in this scope
      85 |     print_vlog_sites(&printer);
         |     ^~~~~~~~~~~~~~~~
   
   **To Reproduce**
   编译选项 -DWITH_SNAPPY=ON -DWITH_GLOG=ON
   
   **Expected behavior**
   编译通过
   
   **Versions**
   OS: Ubuntu 22.04
   Compiler: 
   brpc: 1.14.1 1.16.0
   protobuf: 1.16.0
   
   **Additional context/screenshots**
   发现CMakeLists中149行 set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer")改为
   set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CXX_FLAGS } -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer")
   就可以编译成功
   


-- 
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: issues-unsubscribe@brpc.apache.org.apache.org

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


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


Re: [I] Ubuntu 22.04 编译报错,修改CMakeLists后成功 (brpc)

Posted by "chenBright (via GitHub)" <gi...@apache.org>.
chenBright closed issue #3203: Ubuntu 22.04 编译报错,修改CMakeLists后成功
URL: https://github.com/apache/brpc/issues/3203


-- 
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: issues-unsubscribe@brpc.apache.org

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


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