# Solution to TetrahedronKey\<true\> explicit specialization and implicit instantiation errors 

**URL:** <https://forums.unrealengine.com/t/solution-to-tetrahedronkey-true-explicit-specialization-and-implicit-instantiation-errors/2310995>\
**Category:** Getting Started & Setup\
**Tags:** Linux, linux-build, unreal-engine\
**Created:** [January 30, 2025, 9:41pm UTC](https://forums.unrealengine.com/t/solution-to-tetrahedronkey-true-explicit-specialization-and-implicit-instantiation-errors/2310995 "2025-01-30T21:41:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darmhor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Darmhor](https://forums.unrealengine.com/u/Darmhor)\
**Post date:** [January 30, 2025, 9:41pm UTC](https://forums.unrealengine.com/t/solution-to-tetrahedronkey-true-explicit-specialization-and-implicit-instantiation-errors/2310995/1 "2025-01-30T21:41:07Z")

</div>

Hello everyone,

I think this solution is for a nich problem exiting for years (first post I found about this problem was from 2022).

Sometimes, when you compile Unreal Engine 5 on Linux, you get these errors :

```auto
[917/3988] Compile Module.GeometryAlgorithms.1.cpp
In file included from ../Plugins/Runtime/GeometryProcessing/Intermediate/Build/Linux/x64/UnrealEditor/Development/GeometryAlgorithms/Module.GeometryAlgorithms.1.cpp:26:
/home/[user]/Téléchargements/UnrealEngine-5.3.2/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteTetrahedronKey.cpp:78:27: error: explicit specialization of 'TetrahedronKey' after instantiation
    TetrahedronKey<true>::TetrahedronKey(int v0, int v1, int v2, int v3)
                          ^
/home/[user]/Téléchargements/UnrealEngine-5.3.2/Engine/Plugins/Runtime/GeometryProcessing/Source/GeometryAlgorithms/Private/ThirdParty/GTEngine/Mathematics/GteTSManifoldMesh.cpp:73:26: note: implicit instantiation first required here
    TetrahedronKey<true> skey(v0, v1, v2, v3);
                         ^

```

The solution is to add these four lines :

```c++
    template<> TetrahedronKey<true>::TetrahedronKey();
    template<> TetrahedronKey<true>::TetrahedronKey(int v0, int v1, int v2, int v3);
    template<> TetrahedronKey<false>::TetrahedronKey();
    template<> TetrahedronKey<false>::TetrahedronKey(int v0, int v1, int v2, int v3);

```

at the end of GteTehradronKey.h (same path as in the error message) inside the « if !defined( **MSWINDOWS** ) » condition :

```c++
#if !defined( __MSWINDOWS__ )
    // Apple LLVM 6.1.0 (clang-602.0.49) correctly requires these declarations
    // to occur before the definition in GteTetrahedronKey.cpp. From the C++
    // specification:
    // An explicit specialization of a static data member of a template is
    // a definition if the declaration includes an initializer; otherwise,
    // it is a declaration.
    // If these declarations are exposed for MSVS 2013, the compiler generates
    // error C2086, claiming that this is a definition (rather than a
    // declaration) and the cpp file has a redefinition.
    template<> std::array<int, 3> const TetrahedronKey<false>::oppositeFace[4];
    template<> std::array<int, 3> const TetrahedronKey<true>::oppositeFace[4];

    -> LINES GO HERE ! <-

#endif

```

From what I have seen in the repo, it can happen with version from 5.3 to 5.5.  
So I hope it could help.

---

<div class="post-metadata">

**Author:** ![seventy\_zlp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@seventy\_zlp](https://forums.unrealengine.com/u/seventy_zlp)\
**Post date:** [December 5, 2025, 1:58am UTC](https://forums.unrealengine.com/t/solution-to-tetrahedronkey-true-explicit-specialization-and-implicit-instantiation-errors/2310995/2 "2025-12-05T01:58:18Z")

</div>

Thanks It works on UE 5.2.1 Ubuntu 24.04
