Skip to content
libprotobuf for Unreal Engine 4
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build update compiler script build_win64.py Sep 7, 2018
libprotobuf Delete regenerateforue4.py Sep 7, 2018
protobuf-source @ 48cb18e update protobuf source to v3.6.1 Sep 6, 2018
.gitmodules add submodule google protobuf(v3.1.0) Feb 3, 2017
README.md Update Readme.md Sep 7, 2018

README.md

libprotobuf for Unreal Engine 4

Link the google's protocol bufffers library as the third party in Unreal Engine 4.

Usage

  1. Import or copy the folder 'libprotobuf' into <your project>/Source/ThirdParty/libprotobuf.
  2. Add the libprotobuf as a module into <your project>.Build.cs
  • PrivateDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "libprotobuf" });
  1. Generate two code files (header & source, ex: Message.pb.h & Message.pb.cc) of the protocal by protoc for cpp. (Ref: Google's Protocol Buffers)
  2. Put them into the source directory (Private or Public) of your project.
  3. Add these line in message cpp file(Mesage.pb.cc)
#ifdef _MSC_VER
#pragma warning(disable:4125)
#endif
  1. Regenerate the code file for Unreal Engine 4 by regenerateforue4.py.
    • python regenerateforue4.py 'the header file'
    • ex: python regenerateforue4.py Message.pb.h
    • You should get this information: Success to regenerate the code for UE4
  2. Include and use the header file(ex: Message.pb.h) in your .cpp file.
  3. That's all.

Build Library

  1. Windows: Run build_win64.py (Visual Studio 2017 and CMake is required)
  2. Linux: Run build_linux.py (clang and Unrea Engine Source Code is required)

Reference

  1. https://github.com/code4game/libprotobuf
  2. https://wiki.unrealengine.com/Standalone_Dedicated_Server
  3. https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System
  4. https://wiki.unrealengine.com/Compiling_For_Linux
You can’t perform that action at this time.