# abseil-cpp, absl in thirdparty redefinition error

**URL:** <https://forums.unrealengine.com/t/abseil-cpp-absl-in-thirdparty-redefinition-error/1794996>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, bug-report, CPP, question\
**Created:** [April 9, 2024, 4:15am UTC](https://forums.unrealengine.com/t/abseil-cpp-absl-in-thirdparty-redefinition-error/1794996 "2024-04-09T04:15:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SiwKim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SiwKim](https://forums.unrealengine.com/u/SiwKim)\
**Post date:** [April 9, 2024, 4:15am UTC](https://forums.unrealengine.com/t/abseil-cpp-absl-in-thirdparty-redefinition-error/1794996/1 "2024-04-09T04:15:27Z")

</div>

i am trying to include protobuf lastest version 3.26.1 (ver 2024-04) in unreal 5. (i am using vs2022 community)

when i include protobuf using thirdparty abseil-cpp,  
i face compile error C2373(redefinition). like below

* * *

## Error C2373 ‘absl::container\_internal::node\_type’: redefinition; different type modifiers TestProtoForUnreal C:\Users\blackstorm\_kdongin\Documents\Unreal Projects\TestProtoForUnreal\Source\ThirdParty\abseilcpp\absl\container\internal\btree.h 1653

it seems that absl\container\internal\btree.h causes that error.  
i assume that it conflicts with another absl\btree.h included unreal engine 5 some where.  
i found out several same abseil in unreal engine 5.  
could you fix or recommend a workaround???

---

<div class="post-metadata">

**Author:** ![threepotato](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@threepotato](https://forums.unrealengine.com/u/threepotato)\
**Post date:** [April 19, 2024, 1:50pm UTC](https://forums.unrealengine.com/t/abseil-cpp-absl-in-thirdparty-redefinition-error/1794996/2 "2024-04-19T13:50:59Z")

</div>

I have encountered another problem and I am not sure if it will be helpful to you

- protobuf version 3.26.1 (ver 2024-04)
- Unreal Engine version 5.3
- vs2022 community

**Reason:**  
The function `verify()` defined in the `absl/container/internal/btree. h` and `absl/container/internal/btree. container.h` files conflicts with the `verify(expr)` macro defined in UE5.

**Solution:**  
In the context of function definition, cancel the macro definition of UE.

This is the code that I have personally modified, and there may be other ways to modify it.

1. Around `line 1579` of the `btree.h` file, after modification:

```cpp
#ifdef verify
#undef verify
#endif
  // Verifies the structure of the btree.
  void verify() const;
#ifndef verify
#define verify(expr) UE_CHECK_IMPL(expr) // copy from line 221 of /Engine/Source/Runtime/Core/Public/Misc/AssertionMacros.h
#endif

```

1. Around `line 2610` of the `btree.h` file, after modification:

```cpp
#ifdef verify
#undef verify
#endif
template <typename P>
void btree<P>::verify() const {
  assert(root() != nullptr);
  assert(leftmost() != nullptr);
  assert(rightmost() != nullptr);
  assert(empty() || size() == internal_verify(root(), nullptr, nullptr));
  assert(leftmost() == (++const_iterator(root(), -1)).node_);
  assert(rightmost() == (--const_iterator(root(), root()->finish())).node_);
  assert(leftmost()->is_leaf());
  assert(rightmost()->is_leaf());
}
#ifndef verify
#define verify(expr) UE_CHECK_IMPL(expr) // copy from line 221 of /Engine/Source/Runtime/Core/Public/Misc/AssertionMacros.h
#endif

```

1. Around `line 225` of the `btree_container.h` file, after modification:

```cpp
#ifdef verify
#undef verify
#endif
  void verify() const { tree_.verify(); }
#ifndef verify
#define verify(expr) UE_CHECK_IMPL(expr) // copy from line 221 of /Engine/Source/Runtime/Core/Public/Misc/AssertionMacros.h
#endif

```

Hope it’s helpful  
Best wishes

---

<div class="post-metadata">

**Author:** ![isaac4096](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/isaac4096/32/975064_2.png) [@isaac4096](https://forums.unrealengine.com/u/isaac4096)\
**Post date:** [September 24, 2024, 6:36am UTC](https://forums.unrealengine.com/t/abseil-cpp-absl-in-thirdparty-redefinition-error/1794996/3 "2024-09-24T06:36:44Z")

</div>

I am using UE5.3.2,threepotato’s solution could work if you are building a standalone application,but in my case I was building a plugin,it works fine during development,but would result in a failure if you try to package your plugin.so I tried a more aggressive way: I just delete thost two `verify` functions,they seems to be for test only.Also I uploaded the lib to github with some building instructions.

> **[GitHub - ibreathebsb/ue5-protobuf: using protobuf in unreal engine 5](https://github.com/ibreathebsb/ue5-protobuf)**
>
> using protobuf in unreal engine 5

Hope this can be helpful.

---

<div class="post-metadata">

**Author:** ![oleksii-dtsc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oleksii-dtsc](https://forums.unrealengine.com/u/oleksii-dtsc)\
**Post date:** [February 13, 2026, 9:12pm UTC](https://forums.unrealengine.com/t/abseil-cpp-absl-in-thirdparty-redefinition-error/1794996/4 "2026-02-13T21:12:47Z")

</div>

Thank you so much for your idea - it is a lifesaver!

To save some time for others, you can avoid the third-party code modification by applying the suggested solution before including the grpc-related headers.

For example, like that:

```cpp
#pragma push_macro("verify")
#ifdef verify
    #undef verify
#endif

#include <grpc/grpc.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
#include <grpcpp/security/credentials.h>
// … whatever else you may need to include from the gRPC framework

#include "build/myGeneratedHeader.grpc.pb.h" // This should be generated from your .proto file using protoc with gRPC plugin

#pragma pop_macro("verify") 

```
