brpc icon indicating copy to clipboard operation
brpc copied to clipboard

proto文件中使用“errno”字段,编译时报错

Open xiaoqi902 opened this issue 5 years ago • 2 comments

Describe the bug (描述bug) 在proto文件中使用了“errno”字段,编译时报错 /echo_c++/build/echo.pb.h:199:44: error: 'bthread_errno_location' declared as function returning a function inline ::google::protobuf::int32 errno() const; /echo_c++/build/echo.pb.h:448:56: error: 'bthread_errno_location' declared as function returning a function inline ::google::protobuf::int32 EchoResponse::errno() const { make[2]: *** [CMakeFiles/brpc_server.dir/server.cpp.o] Error 1 make[1]: *** [CMakeFiles/brpc_server.dir/all] Error 2 make: *** [all] Error 2

To Reproduce (复现方法) 在protobuf中定义message

message EchoResponse { required string message = 1; required int32 errno = 2; }; 然后编译时就会报上面的错误

Versions (各种版本) OS: centos7 Compiler: gcc4.8.5 brpc: master protobuf: libprotoc 2.5.0

xiaoqi902 avatar Jan 07 '20 06:01 xiaoqi902

https://en.cppreference.com/w/cpp/error/errno

zyctree avatar Jan 07 '20 07:01 zyctree

问题后来解决了吗

Jackwongupc avatar Apr 06 '22 02:04 Jackwongupc