Unreal Engine 4
libprotobuf forLink the google's protocol bufffers
library as the third party in Unreal Engine 4.
Prerequisites
- Python v3 (for install and build scripts)
- depending on you building platform:
Usage
- Clone or add this repository as submodule to your project directory.
- Go into the just created directory and run
./install.py
. This will build protobuf and copy the compiled version into the ThirdParty directory of your project (<your project>/Source/ThirdParty/libprotobuf
). - Add the libprotobuf as a module into
<your project>.Build.cs
PrivateDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "libprotobuf" });
- Generate protobuf code files (header & source, ex: Message.pb.h & Message.pb.cc) of your protocol files (.proto) by
protoc
forcpp
(The protoc executable is located in<your project>/Source/ThirdParty/libprotobuf/bin
). (Ref: Google's Protocol Buffers) - Put the resulting files into the source directory of your project.
- Regenerate these code files for Unreal Engine 4 by
regenerateforue4.py
.python regenerateforue4.py Message.pb.h
python regenerateforue4.py Message.pb.cc
- You should get this information:
Success to regenerate the code for UE4
- Include and use the header file (ex: Message.pb.h) in your
.cpp
file. - That's all.