brpc
brpc copied to clipboard
Duplicate function definition EVP_PKEY_base_id
I'm having trouble building brpc with GCC 5.2.0
The error compiler reported is:
In file included from /home/xxx/code/git/Serving/build/third_party/brpc/src/extern_brpc/src/brpc/policy/dh.cpp:20:0:
./butil/ssl_compat.h: In function ‘int EVP_PKEY_base_id(const EVP_PKEY*)’:
./butil/ssl_compat.h:520:17: error: redefinition of ‘int EVP_PKEY_base_id(const EVP_PKEY*)’
BRPC_INLINE int EVP_PKEY_base_id(const EVP_PKEY *pkey) {
^
./butil/ssl_compat.h:516:17: note: ‘int EVP_PKEY_base_id(const EVP_PKEY*)’ previously defined here
BRPC_INLINE int EVP_PKEY_base_id(const EVP_PKEY *pkey) {
Looking into src/butil/ssl_compat.h, there's definitely duplicate function definition of EVP_PKEY_base_id:
https://github.com/apache/incubator-brpc/blob/master/src/butil/ssl_compat.h#L515
Not sure why building brpc with other toolchain not complain about this.
According to C++ standard, inline functions would not be applied by One Definition Rule. The complier is not required to report the error. But In this case, these two functions are exactly same. It's ok to remove one of them.
Fixed in https://github.com/apache/incubator-brpc/pull/841