# Critical compilation error - UE5.4, MacOS, FMOD 2.03.08 (down to 2.02.22)

**URL:** <https://qa.fmod.com/t/critical-compilation-error-ue5-4-macos-fmod-2-03-08-down-to-2-02-22/23116>\
**Category:** Unreal Engine\
**Created:** [July 3, 2025, 1:55pm UTC](https://qa.fmod.com/t/critical-compilation-error-ue5-4-macos-fmod-2-03-08-down-to-2-02-22/23116 "2025-07-03T13:55:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ciberus](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ciberus/32/5547_2.png) [@Ciberus](https://qa.fmod.com/u/Ciberus)\
**Post date:** [July 3, 2025, 1:55pm UTC](https://qa.fmod.com/t/critical-compilation-error-ue5-4-macos-fmod-2-03-08-down-to-2-02-22/23116/1 "2025-07-03T13:55:31Z")

</div>

On both versions of FMOD plugin for Unreal 2.02.22 and 2.03.08 build crashes on MacOS with error

```auto
[76/124] Compile [Apple] FMODStudioModule.cpp
/Volumes/PROJECT/UNREAL_PROJECT/space_dog/Plugins/FMODStudio/Source/FMODStudio/Private/FMODStudioModule.cpp:743:43: error: object backing the pointer advStudioSettings.encryptionkey will be destroyed at the end of the full-expression [-Werror,-Wdangling-assignment]
  743 | advStudioSettings.encryptionkey = TCHAR_TO_UTF8(*Settings.StudioBankKey);
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/Epic Games/UE_5.4/Engine/Source/Runtime/Core/Public/Containers/StringConv.h:1002:159: note: expanded from macro 'TCHAR_TO_UTF8'
 1002 | #define TCHAR_TO_UTF8(str) /*UE_DEPRECATED_MACRO(5.xx, "TCHAR_TO_UTF8(Ptr) is deprecated, please use StringCast<UTF8CHAR>(PtrToTChar) instead.")*/ (ANSICHAR*)FTCHARToUTF8((const TCHAR*)str).Get()
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

```

Thats started after updating xcode recently to have opportunity to run UE5.5. Looks like unreal interprets such warnings from plugins as errors by default

Full log  
[14Overmind (10).log](https://qa.fmod.com/uploads/short-url/iN92g7LImQJEwVmtXtFnmhkduyN.log) (24.7 KB)

---

<div class="post-metadata">

**Author:** ![Ciberus](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ciberus/32/5547_2.png) [@Ciberus](https://qa.fmod.com/u/Ciberus)\
**Post date:** [July 3, 2025, 2:22pm UTC](https://qa.fmod.com/t/critical-compilation-error-ue5-4-macos-fmod-2-03-08-down-to-2-02-22/23116/2 "2025-07-03T14:22:42Z")

</div>

Found temporary fix - in FMOD plugin just wrap this line with clang ignore

```C++
// Plugins/FMODStudio/Source/FMODStudio/Private/FMODStudioModule.cpp
    if (!Settings.StudioBankKey.IsEmpty())
    {
#if defined( __clang__ )
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdangling-assignment"
#endif

        advStudioSettings.encryptionkey = TCHAR_TO_UTF8(*Settings.StudioBankKey);

#if defined( __clang__ )
#pragma clang diagnostic pop
#endif
    }

```

---

<div class="post-metadata">

**Author:** ![Ciberus](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/ciberus/32/5547_2.png) [@Ciberus](https://qa.fmod.com/u/Ciberus)\
**Post date:** [July 3, 2025, 4:01pm UTC](https://qa.fmod.com/t/critical-compilation-error-ue5-4-macos-fmod-2-03-08-down-to-2-02-22/23116/3 "2025-07-03T16:01:27Z")

</div>

k it seems unstable when we have `bForceCompilationAtStartup` enabled and after second run it throws error again better to just fix it

```c++
#include "Containers/StringConv.h"

// replace this
// advStudioSettings.encryptionkey = TCHAR_TO_UTF8(*Settings.StudioBankKey);

// by this
FTCHARToUTF8 EncryptionKeyUtf8(*Settings.StudioBankKey);
advStudioSettings.encryptionkey = EncryptionKeyUtf8.Get();

```

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [July 9, 2025, 5:36am UTC](https://qa.fmod.com/t/critical-compilation-error-ue5-4-macos-fmod-2-03-08-down-to-2-02-22/23116/4 "2025-07-09T05:36:41Z")

</div>

Thank you for reporting this. We have a fix ready for the next release:

```auto
    if (!Settings.StudioBankKey.IsEmpty())
    {
        auto conv = StringCast<TCHAR>(*Settings.StudioBankKey);
        advStudioSettings.encryptionkey = (const char*)conv.Get();
    }

```
