# Is it possible to link / build parts of the Unreal Engine source with your own project?

**URL:** <https://forums.unrealengine.com/t/is-it-possible-to-link-build-parts-of-the-unreal-engine-source-with-your-own-project/34198>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [July 3, 2015, 3:19pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-link-build-parts-of-the-unreal-engine-source-with-your-own-project/34198 "2015-07-03T15:19:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_683d4c63](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_683d4c63](https://forums.unrealengine.com/u/anonymous_user_683d4c63)\
**Post date:** [July 3, 2015, 3:19pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-link-build-parts-of-the-unreal-engine-source-with-your-own-project/34198/1 "2015-07-03T15:19:31Z")

</div>

Hello 🙂

I downloaded the latest Unreal Engine source from GitHub and have been able to build it with VS2013 CE.

In my [former thread](https://forums.unrealengine.com/showthread.php?73005-ARK-Server-Side-Plugin-Mutator) I’ve asked if it is possible to build a “Mutator” which can be used for the game “ARK: Survival Evolved” to create server-side plugins. But as we found out, it is not possible, since these mentioned “Mutators” are only supported by “Unreal Tournament”.

However, we managed to build a server-side plugin system using DLL-Injection and Function Hooking / Function Routing: [[DISCONTINUED] Base Raiding Protection (v1.3.5) :: ARK: Survival Evolved General Discussions](http://steamcommunity.com/app/346110/discussions/0/594821545177819162/)

This works great. Now we would like to extend our plugins but ran into some problems.

For instance we would like to hook a function called

```auto

AShooterPlayerController::ServerSendChatMessage(AShooterPlayerController *this, FString *ChatMessage, int SendMode)

```

The hook works in general. But so far we have been unable to resolve “FString \*ChatMessage”. No matter what we try, we either only get the first letter of the sent text or just “garbage”, which looks like pointers / addresses, but we have not been able to access the memory behind them.

So my idea was, to link parts (header files) of the UE into our own projects, to enable accessing to these proper types and use them to declare our detour functions.

Unfortunately some first attempts didn’t work out. I have been able to build the whole UE, but when I add the desired include paths and header files (for instance “./Containers/UnrealString.h”) to our test project, I’m unable to build and run into quite some error messages, like

```auto

static FORCEINLINE void* Memmove( void* Dest, const void* Src, SIZE_T Count )
Error	3	error C2433: 'FMemory::int32' : '__forceinline' not permitted on data declarations	c:\projects\unrealengine\engine\source\runtime\core\public\hal\UnrealMemory.h

static FORCEINLINE void* Memset(void* Dest, uint8 Char, SIZE_T Count)
Error	7	error C2061: syntax error : identifier 'uint8'	c:\projects\unrealengine\engine\source\runtime\core\public\hal\UnrealMemory.h

template< class T >
DEPRECATED(4.8, "Please use Memset.")
static FORCEINLINE void MemSet( T& Src, uint8 ValueToSet )
Error	9	error C2988: unrecognizable template declaration/definition	c:\projects\unrealengine\engine\source\runtime\core\public\hal\UnrealMemory.h

```

etc.

So any advice on how to get this compiled? Did any of you guys already attempt this? Advice on compiler settings, etc?

Thank you! Any help is appreciated! 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_683d4c63](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_683d4c63](https://forums.unrealengine.com/u/anonymous_user_683d4c63)\
**Post date:** [July 4, 2015, 4:40pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-link-build-parts-of-the-unreal-engine-source-with-your-own-project/34198/2 "2015-07-04T16:40:27Z")

</div>

Ok, thats nice. Problem solved. 😃

We found out, that you can create an UE4 Editor Plugin (derived from UE4/Engine/Plugins/Developer/BlankPlugin) and modify it so that it works as a normal DLL (having its entrypoint at DllMain). Then we can include our hooking / routing library and handle it from there on.

 ![b854355e452aa080d4d12d0f5574c2ce54487006.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/5/b854355e452aa080d4d12d0f5574c2ce54487006.jpeg)

By the way:

Is there a better method to access FString characters without using an iterator? Or how can I convert a FString to a string?

```auto

string receivedMessage = "";

for (auto& msgChar : *chatMessage)
{
	receivedMessage += msgChar;
}
sprintf_s(message, "Received: %s", receivedMessage);

```

---

<div class="post-metadata">

**Author:** ![Agentleo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Agentleo](https://forums.unrealengine.com/u/Agentleo)\
**Post date:** [July 4, 2015, 7:58pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-link-build-parts-of-the-unreal-engine-source-with-your-own-project/34198/3 "2015-07-04T19:58:52Z")

</div>

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_683d4c63](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_683d4c63](https://forums.unrealengine.com/u/anonymous_user_683d4c63)\
**Post date:** [July 4, 2015, 8:21pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-link-build-parts-of-the-unreal-engine-source-with-your-own-project/34198/4 "2015-07-04T20:21:10Z")

</div>

Thanks! 🙂

```auto

string receivedMessage(TCHAR_TO_UTF8(**chatMessage));

```

Works.
