Skip to content

zjfls/libprotobuf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

libprotobuf for Unreal Engine 4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.4%
  • Other 1.6%