Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

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.

Product Version: UE 4.16
more ▼

asked Oct 09 '17 at 08:20 AM in Linux

avatar image

6 1 2 4

avatar image liweimin90 Oct 09 '17 at 08:23 AM

alt text

ue4diff.jpg (662.1 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.


Doug Wilson

more ▼

answered Oct 10 '17 at 02:14 PM

avatar image liweimin90 Oct 11 '17 at 02:02 AM

Thanks Doug Wilson. 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.

avatar image RCL STAFF Oct 11 '17 at 02:41 AM

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.

avatar image think01 Sep 07 '18 at 10:54 AM

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.

avatar image ELiveikis Apr 24 '18 at 03:31 PM

Hi Doug, 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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question