Is it possible to compile RakNet using UE4?

Can anyone help me how to add RakNet (GitHub - facebookarchive/RakNet: RakNet is a cross platform, open source, C++ networking engine for game programmers.), to UE4/Source/ThirdParty and to make RakNet.Build.cs?

Do i need precompiled RakNet/Libs? Can i compile them using UE4?

Steps to add RakNet (release) to UE4:

  • Download RakNet.

  • Copy “RakNet-master” folder to “UE4/Engine/Source/ThirdParty/RakNet/”.

  • Create there “RakNet.Build.cs”

    using UnrealBuildTool;

    public class RakNet : ModuleRules
    public RakNet(TargetInfo Target)
    Type = ModuleType.External;

     	if (Target.Platform == UnrealTargetPlatform.Win64)
     		PublicIncludePaths.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "RakNet/RakNet-master/Source/");
             PublicLibraryPaths.Add(UEBuildConfiguration.UEThirdPartySourceDirectory + "RakNet/RakNet-master/Lib/");


  • Open RakNet_VS2008.sln with VS2013. Conversion will be automatically fine.

  • Set build mode “Release” / “x64”.

  • Change “LibStatic” project properties: C/C++/CodeGeneration/Runtime Library = Multi-threaded DLL (taken from A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums)

  • Build “LibStatic”.

  • Add to your “Project.Build.cs” following:


I got 156 error same as

Error 1 error C2872: ‘INT’ : ambiguous symbol C:\Program Files (x86)\Windows Kits\8.1\include\shared\ws2def.h 249 1

Error 10 error C2872: ‘INT’ : ambiguous symbol or ‘e:\unreal engine 4.7\unrealengine\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(28) : DoNotUseOldUE4Type::INT’ C:\Program Files (x86)\Windows Kits\8.1\include\shared\ws2def.h 674 1

Error 20 error C2872: ‘DWORD’ : ambiguous symbol C:\Program Files (x86)\Windows Kits\8.1\include\um\WinSock2.h 942 1

You need to use special UE4 includes wrapped around to Raknet includes:

#include "AllowWindowsPlatformTypes.h" // UE4

#include "RakPeerInterface.h"
#include "MessageIdentifiers.h"
#include "BitStream.h"
#include "RakNetTypes.h"
#include "Rand.h"

#include "HideWindowsPlatformTypes.h" // UE4

Can you explain it more specific ?
“Add to your “Project.Build.cs” following:” where is this file?
I did conversion to vs2013 the multidll was already selected for me and the build went without errors, just i dont have the file you mention to add that last line, when i start UE4 and go to the plugins it does not show up.
Please Help

Create any new project in UE4 and you will have in VisualStudio following file inside your project → NameOfYourProject.Build.cs.

Thanks, I got that file and added that line in there.
All goes fine but the plugin still does not show up in my plugins list though :S
I get no compile errors when i compile it, still no plugin showing up in my plugin browser, only the ones which come with unreal.
I wonder if someone could help me out getting this plugin inside UE4 working, as my game needs a lobby server to browse the games, unfortunetly UE4 only support that with steam, which i dont realy like to use, as they decide to release your game or not.
I use unity as well but i like UE4 more, just the networking is still behind with features.
Anyone can help me out to get this plugin working i would apreciate.

@ newbprofi Did you get it compiled as a plugin ?
Could you share the plugin or make a clear how to do this as I am still stuck.
It would help a lot of people if we would more easy understand.
My coding skill is at a very low level (as others) please help us out.

its not plugin.

There is a new rakenet plugin example on github, not sure if it works but might be helpful.

Where is the Link please ???
is it this one ?