error: redefinition of 'AllocateAligned'

前提

当我在执行 bazel run xxx启动服务的时候,报错: 重复定义

external/com_google_protobuf/src/google/protobuf/arena.cc:147:18: error: redefinition of 'AllocateAligned'
void* ArenaImpl::AllocateAligned(size_t n) {
                 ^
/usr/local/include/google/protobuf/arena_impl.h:110:9: note: previous definition is here
  void* AllocateAligned(size_t n) {
        ^
external/com_google_protobuf/src/google/protobuf/arena.cc:191:47: error: redefinition of 'GetSerialArenaFast'
inline PROTOBUF_ALWAYS_INLINE bool ArenaImpl::GetSerialArenaFast(
                                              ^
/usr/local/include/google/protobuf/arena_impl.h:331:31: note: previous definition is here
  PROTOBUF_ALWAYS_INLINE bool GetSerialArenaFast(SerialArena** arena) {

分析原因:

我看错误信息里面包含了/usr/local/include/google/protobuf/ 这个路径,由此我怀疑是因为我本地安装了 protobuf 才导致重复定义的。

于是我brew list 查看了一下安装的包。发现的确存在 protobuf

当我尝试 brew uninstall protobuf的时候,提示我 protobuf被 MySQL 依赖着。所以我决定卸载 MySQL

可以通过 brew info mysql查看了一下 MySQL 的依赖。

猜你喜欢

转载自www.cnblogs.com/shanezh/p/error-redefinition-of-allocatealigned.html