# Add grpc and protobuf to Ue4 ,build failed without libcxx，

**URL:** <https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543>\
**Category:** C++\
**Tags:** linux-build, unreal-engine, UE4, question, CPP\
**Created:** [October 9, 2017, 8:20am UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543 "2017-10-09T08:20:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_fcf0814b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fcf0814b1](https://forums.unrealengine.com/u/anonymous_user_fcf0814b1)\
**Post date:** [October 9, 2017, 8:20am UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/1 "2017-10-09T08:20:20Z")

</div>

Hi, there:

I want to add grpc and protobuf to my ue4 project. I have success add them on my mac by add include file and libs. but when I try on linux (ubuntu 16.04, build ue4 16.3 release version from source code). Something is Wrong:

Firstly, when I run the project, it said ‘undefined symbol \_ZNK6google8protobuf7Message11GetTypeNameEv’ because of protobuf head file compiled by ue4 build tool , but I have ‘\_ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev’ in binary file , witch build with local c++ libs.

Secondly, I use the ‘UE4\_LINUX\_USE\_LIBCXX=0’ and try to build ue4 with local c++libs, but I found that, many third party libs only have head files and \*.a lib witch has been build with LibCxx(I think). Maybe I shoud not use ‘UE4\_LINUX\_USE\_LIBCXX=0’.

So , what shoud I do, try to build protobuf and grpc use clang and Libcxx? It looks still many problems about it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fcf0814b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fcf0814b1](https://forums.unrealengine.com/u/anonymous_user_fcf0814b1)\
**Post date:** [October 9, 2017, 8:23am UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/2 "2017-10-09T08:23:58Z")

</div>

![216119-ue4diff.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/f/4/2f4988ae3951787c3b0159eb068c3b0259d217d3.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2b03d27c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2b03d27c](https://forums.unrealengine.com/u/anonymous_user_2b03d27c)\
**Post date:** [October 10, 2017, 2:14pm UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/3 "2017-10-10T14:14:31Z")

</div>

Hey liweimin90-

There are a couple of things I’d like to address. First, make sure that you compile grpc and protobuf libs using the same compiler and the same C++ library as the main engine. Make sure that the same C++ standard is passed to both too (engine uses -std=c++14 since 4.15)

Secondly, you will need to rebuild bundled third party libraries to use local C++ libraries as well. The sources are included in the engine distribution. Let me know if this info helps.

Cheers

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fcf0814b1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fcf0814b1](https://forums.unrealengine.com/u/anonymous_user_fcf0814b1)\
**Post date:** [October 11, 2017, 2:02am UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/4 "2017-10-11T02:02:03Z")

</div>

Thanks . Finally, I compiled protobuf and grpc with clang and LibCxx，it works. But when i stop the UE4Editor, it core dumped. I will try to fix it, maybe needs some compile flag.

---

<div class="post-metadata">

**Author:** ![RCL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RCL](https://forums.unrealengine.com/u/RCL)\
**Post date:** [October 11, 2017, 2:41am UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/5 "2017-10-11T02:41:32Z")

</div>

You can load the core into gdb and bt that. Most likely something gets destroyed too late - make sure you clean up everything on module shutdown.

---

<div class="post-metadata">

**Author:** ![ELiveikis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ELiveikis](https://forums.unrealengine.com/u/ELiveikis)\
**Post date:** [April 24, 2018, 3:31pm UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/6 "2018-04-24T15:31:52Z")

</div>

Hi , thanks for your reply.  
What would you say is the better approach: setup a linux machine with the same toolchain as the cross-compiler and build there using existing build scripts (e.g. cmake), or build using the cross-compiler on windows and go through the extra effort of supporting the custom toolchain.

The first approach seems easier, but I’m not sure what issues there might be with other differences between UE4’s cross-compiler and the replicated environment.

---

<div class="post-metadata">

**Author:** ![think01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/think01/32/713467_2.png) [@think01](https://forums.unrealengine.com/u/think01)\
**Post date:** [September 7, 2018, 10:54am UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/7 "2018-09-07T10:54:18Z")

</div>

Hello. Could you please share the compiler commands and options with which you compiled protobuf? I’m trying to recompile them with same compiler (clang) and options (-std=c++14) used for Unreal Engine, but I still get the same linking error (‘undefined symbol \_ZNK6google8protobuf7Message11GetTypeNameEv’). Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_727137af](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_727137af](https://forums.unrealengine.com/u/anonymous_user_727137af)\
**Post date:** [June 4, 2021, 12:25pm UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/8 "2021-06-04T12:25:40Z")

</div>

Can anyone share what are the needed configuration to build gRPC using UE4 Linux Toolchain.

I am getting several errors:

> ld.lld: error: undefined symbol: std::\_\_throw\_out\_of\_range(char const\*)  
> 00:06:11.679 \>\>\> referenced by bind.cc.o: (absl::lts\_2020\_09\_23::str\_format\_internal::AppendPack(std::string\*,

This happens a lot related wih std:: functions in use in gRPC.

I am using CMAKE with DCMAKE\_TOOLCHAIN\_FILE using UE4 linux clang toolchain.

I would love to see how did you solve the use of LibCxx, I think it’s what is causing errors in my case.

---

<div class="post-metadata">

**Author:** ![6r0m](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/6r0m/32/1194563_2.png) [@6r0m](https://forums.unrealengine.com/u/6r0m)\
**Post date:** [December 12, 2023, 7:17am UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/9 "2023-12-12T07:17:25Z")

</div>

check full command to build grpc [here](https://forums.unrealengine.com/t/compiling-libraries-in-linux/400275/9)

at the end, I received some “undefined symbol” from abseil, but for the system calls. in this case you could change this functions to analog and recompile abseil.

---

<div class="post-metadata">

**Author:** ![cyb201](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cyb201/32/956468_2.png) [@cyb201](https://forums.unrealengine.com/u/cyb201)\
**Post date:** [December 13, 2023, 6:58am UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/13 "2023-12-13T06:58:56Z")

</div>

Hello, finally I got undefined symbols from libwebrtc.a, for example

```auto
ld.lld: error: undefined symbol: absl::base_internal::LowLevelAlloc::Free(void*)
UATHelper: 打包 (Linux): >>> referenced by create_thread_identity.cc
UATHelper: 打包 (Linux): >>> create_thread_identity.o:(absl::synchronization_internal::ReclaimThreadIdentity(void*)) in archive F:/UE4/UE_5.1/Engine/Source/ThirdParty/WebRTC/4664/Lib/Linux/x86_64-unknown-linux-gnu/Release/libwebrtc.a

```

Is there any specific solution?This Error only happen in absl::base\_internal::LowLevelAlloc::Free(void\*) and absl::base\_internal::LowLevelAlloc::Alloc(unsigned long) .Maybe there’s some special way to handle it.Thanks again

---

<div class="post-metadata">

**Author:** ![cyb201](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cyb201/32/956468_2.png) [@cyb201](https://forums.unrealengine.com/u/cyb201)\
**Post date:** [December 14, 2023, 1:38pm UTC](https://forums.unrealengine.com/t/add-grpc-and-protobuf-to-ue4-build-failed-without-libcxx/406543/14 "2023-12-14T13:38:25Z")

</div>

Hello, I have also encountered these undefined errors. Here is my solution.May I ask if this is helpful to you  
[https://forums.unrealengine.com/t/undefined-symbols-when-using-grpc/1522232?u=cyb201](https://forums.unrealengine.com/t/undefined-symbols-when-using-grpc/1522232)
