# std::thread for game's plugin

**URL:** <https://forums.unrealengine.com/t/std-thread-for-games-plugin/323677>\
**Category:** Plugins\
**Tags:** unreal-engine, Plugins, CPP, question\
**Created:** [July 1, 2015, 1:02pm UTC](https://forums.unrealengine.com/t/std-thread-for-games-plugin/323677 "2015-07-01T13:02:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxPonka](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MaxPonka](https://forums.unrealengine.com/u/MaxPonka)\
**Post date:** [July 1, 2015, 1:02pm UTC](https://forums.unrealengine.com/t/std-thread-for-games-plugin/323677/1 "2015-07-01T13:02:14Z")

</div>

I was using the std::thread and std::mutex for the code that I’m using.

But apparently std::thread has an #include concrt.h statement inside of its header. So Unreal gives me the error(when I tried to package game):

```
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\concrt.h(313) : error C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\concrt.h(4774) : error C3861: '__uncaught_exception': identifier not found

```

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [July 1, 2015, 3:36pm UTC](https://forums.unrealengine.com/t/std-thread-for-games-plugin/323677/2 "2015-07-01T15:36:04Z")

</div>

Use UE4 APIs instead of standard C++ Standard libery. This way threads will be visible by engine and they will show up in UE4 profiler. Here you got basic tutorial:

> **[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...

UE4 has a lot of standard API wrapped up and by using those wrappers you sure that you code will build and run on any platfrom that UE4 supports as well as they be managed by UE4. So search for functions in UE4 APIs first and if you don’t find anything try using other APIs

The error it self seems to be cause by compiler options, which are managed by UBT. But i don’t think there way to set up in UBT, maybe in UBT configs in saved
