libprotobuf for Unreal Engine 4
Link the google's protocol bufffers library as the third party in Unreal Engine 4.
- Import or copy the folder 'libprotobuf' into
<your project>/ThirdParty/libprotobuf. - Add the libprotobuf as a module into
<your project>.Build.cs
PrivateDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "libprotobuf" });
- Generate two code files (header & source, ex: Message.pb.h & Message.pb.cc) of the protocal by
protocforcpp. (Ref: Google's Protocol Buffers) - Put them into the source directory (
PrivateorPublic) of your project. - 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
- Include and use the header file(ex: Message.pb.h) in your
.cppfile. - That's all.
- Windows: Run
build_win64.py(Visual Studio 2015 and CMake is required) - Linux: Run
build_linux.py(clang and Unrea Engine Source Code is required)
There is a blog about this library(chinese)