<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by flarion on Medium]]></title>
        <description><![CDATA[Stories by flarion on Medium]]></description>
        <link>https://medium.com/@0xflarion?source=rss-fd12c1269dc5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7mwIvTOP2xA8osgE.jpeg</url>
            <title>Stories by flarion on Medium</title>
            <link>https://medium.com/@0xflarion?source=rss-fd12c1269dc5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:41:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xflarion/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using UE4 w/ Google Protocol Buffers]]></title>
            <link>https://medium.com/@0xflarion/using-ue4-w-google-protocol-buffers-ae7cab820d84?source=rss-fd12c1269dc5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae7cab820d84</guid>
            <category><![CDATA[unreal-engine]]></category>
            <category><![CDATA[google-protocol-buffers]]></category>
            <category><![CDATA[cpp]]></category>
            <dc:creator><![CDATA[flarion]]></dc:creator>
            <pubDate>Tue, 29 Aug 2017 08:51:32 GMT</pubDate>
            <atom:updated>2017-09-20T11:52:08.605Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc/4.0/</cc:license>
            <content:encoded><![CDATA[<p>So, I needed a UE4 plugin which uses Google Protocol Buffers (GPB). Easy enough. Unfortunately, it was harder than i thought to integrate it.</p><p>Setup: UE4 4.17, x64, Google Protocol Buffers (master branch, commit c7457e)</p><p>Here are the steps i did:<br>1. I used cmake-gui to generate the solution files for GPB</p><ul><li>uncheck protobuf_MSVC_STATIC_RUNTIME</li><li>uncheck protobuf_BUILD_SHARED_LIBS</li><li>change /MDd to /MD</li></ul><p>2. In the file generated_messages_table_driven.h</p><pre>static_assert(std::is_pod&lt;AuxillaryParseTableField&gt;::value, &quot;&quot;);</pre><p>to</p><pre>//static_assert(std::is_pod&lt;AuxillaryParseTableField&gt;::value, &quot;&quot;);</pre><p>3. In the build.cs of the module, I added the following function:</p><pre>public bool LoadGoogleProtocolBuffers(ReadOnlyTargetRules Target)<br>    {<br>        bool isLibrarySupported = false;</pre><pre>if ((Target.Platform == UnrealTargetPlatform.Win64))<br>        {<br>            isLibrarySupported = true;</pre><pre>string LibrariesPath = Path.Combine(ThirdPartyPath, &quot;libprotobuf&quot;, &quot;lib&quot;);</pre><pre>Console.WriteLine(&quot;... LibrariesPath -&gt; &quot; + LibrariesPath);<br>            PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, &quot;libprotobufd&quot; + &quot;.lib&quot;));<br>        }</pre><pre>if (isLibrarySupported)<br>        {<br>            string IncludePath= Path.Combine(ThirdPartyPath, &quot;libprotobuf&quot;, &quot;include&quot;);</pre><pre>Console.WriteLine(&quot;... IncludePath -&gt; &quot; + IncludePath);<br>            PrivateIncludePaths.Add(IncludePath);<br>        }</pre><pre>Definitions.Add(string.Format(&quot;WITH_GPB_BINDING={0}&quot;, isLibrarySupported ? 1 : 0));</pre><pre>return isLibrarySupported;<br>    }</pre><p>4. I call this function from within the constructor of the module</p><p>5. I wrapped all includes of my *pb.h files with</p><pre>#include &quot;AllowWindowsPlatformTypes.h&quot;<br>#include &quot;...*.pb.h &quot;<br>#include &quot;HideWindowsPlatformTypes.h&quot;&#39;</pre><p>6. Added the *pb.c files to the plugin project (private section)</p><p>7. I also had to ignore some warning:</p><pre>#pragma warning (disable : 4800) // forcing value to bool true or false<br>#pragma warning (disable : 4125) // decimal digit terminates octal escape sequence<br>#pragma warning (disable : 4647) // behavior change __is_pod has different value in previous version<br>#pragma warning (disable : 4668) // &#39;symbol&#39; is not defined as a preprocessor macro, replacing with &#39;0&#39; for &#39;directives&#39;</pre><p>Note: One thing I came across is the following issue with the check macro defined by UE4 and protobuf.</p><p><a href="https://answers.unrealengine.com/questions/241746/error-c3861-identifier-not-found-when-including-pr.html">Error C3861 (identifier not found) when including protocol buffers - UE4 AnswerHub</a></p><p>Here’s what I had to do in type_traits.h of protobuf:</p><pre>template&lt;typename B, typename D&gt;<br>struct is_base_of {<br>  typedef char (&amp;yes)[1];<br>  typedef char (&amp;no)[2];</pre><pre>// BEGIN GOOGLE LOCAL MODIFICATION -- check is a #define on Mac.<br>  //#undef check<br>  // END GOOGLE LOCAL MODIFICATION</pre><pre>static yes checkUnrealFix(const B*);<br>  static no checkUnrealFix(const void*);</pre><pre>enum {<br>    value = sizeof(checkUnrealFix(static_cast&lt;const D*&gt;(NULL))) == sizeof(yes),<br>  };<br>};</pre><p>This might also work with the release version 3.4, I did not check that yet.</p><p>With this setup, I’m able to receive a protocol buffer send via TCP/IP and access all properties. I wasn’t able to test more.</p><p>If you have any questions, feel free to ask :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae7cab820d84" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>