# Cannot package app

**URL:** <https://community.cesium.com/t/cannot-package-app/17911>\
**Category:** Cesium for Unreal\
**Created:** [March 29, 2022, 7:49am UTC](https://community.cesium.com/t/cannot-package-app/17911 "2022-03-29T07:49:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![M003TSkyReal](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m003tskyreal/32/3476_2.png) [@M003TSkyReal](https://community.cesium.com/u/M003TSkyReal)\
**Post date:** [March 29, 2022, 7:49am UTC](https://community.cesium.com/t/cannot-package-app/17911/1 "2022-03-29T07:49:14Z")

</div>

Cannot package app

Hello,

I’m currently trying to package my Unreal app using Cesium but I get packaging error  
LNK2005 : “protected: \_\_cdecl tinyxml2::XMLComment::XMLComment(class tinyxml2::XMLDocument \*)” (??0XMLComment@tinyxml2@@IEAA@PEAVXMLDocument@1@@Z) already defined in tinyxml2.lib(tinyxml2.obj)"  
which seems to happen when using the Unreal nDisplay plugin which is already including tinyxml2.  
Could it be possible to change the name of the lib to include to avoid future include conflicts ?

Sincerely yours,

---

<div class="post-metadata">

**Author:** ![jalbert](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/jalbert/32/8661_2.png) [@jalbert](https://community.cesium.com/u/jalbert)\
**Post date:** [March 29, 2022, 10:09am UTC](https://community.cesium.com/t/cannot-package-app/17911/2 "2022-03-29T10:09:48Z")

</div>

> [@M003TSkyReal](#):
>
> Error LNK2005

Means you are linking in the same code from two different places.

---

<div class="post-metadata">

**Author:** ![M003TSkyReal](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m003tskyreal/32/3476_2.png) [@M003TSkyReal](https://community.cesium.com/u/M003TSkyReal)\
**Post date:** [March 29, 2022, 12:09pm UTC](https://community.cesium.com/t/cannot-package-app/17911/3 "2022-03-29T12:09:08Z")

</div>

Yes I understood that, tinyxml is included both in Cesium and inside Unreal Engine with their nDisplay plugin. What can I do to avoid this issue if I still want to package with Cesium ? Thanks.

---

<div class="post-metadata">

**Author:** ![M003TSkyReal](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m003tskyreal/32/3476_2.png) [@M003TSkyReal](https://community.cesium.com/u/M003TSkyReal)\
**Post date:** [March 30, 2022, 2:01pm UTC](https://community.cesium.com/t/cannot-package-app/17911/4 "2022-03-30T14:01:20Z")

</div>

> [@jalbert](#):
>
> Means you are linking in the same code from two different places.

Hi Jalbert, thanks for your answer, and obviously, the issue comes from the tinyxml2.lib that is imported in Cesium and NDisplay plugin.  
The issue is easily reproducable in a new Unreal empty project by enabling Cesium, NDisplay and packaging the project. No code is needed to make it crash.

I assume that we will not be the only ones trying to use Cesium in virtual production context.  
Do you have any idea on how we could get around this issue ?

---

<div class="post-metadata">

**Author:** ![agallegos](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/agallegos/32/4464_2.png) [@agallegos](https://community.cesium.com/u/agallegos)\
**Post date:** [March 30, 2022, 5:02pm UTC](https://community.cesium.com/t/cannot-package-app/17911/5 "2022-03-30T17:02:48Z")

</div>

Hello @M003TSkyReal,

Thank you for bringing this to our attention! I’ve created an issue [here](https://github.com/CesiumGS/cesium-unreal/issues/804) so that we can track this and hopefully find a solution soon. I’ll also reach out to the engineering team to see if there’s a quick workaround in the meantime.

-Alex

---

<div class="post-metadata">

**Author:** ![M003TSkyReal](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m003tskyreal/32/3476_2.png) [@M003TSkyReal](https://community.cesium.com/u/M003TSkyReal)\
**Post date:** [April 19, 2022, 9:57am UTC](https://community.cesium.com/t/cannot-package-app/17911/6 "2022-04-19T09:57:04Z")

</div>

Thank you @agallegos,

We asked Epic on our end for a solution in [this](https://udn.unrealengine.com/s/question/0D74z000005GGj5CAG/detail?s1oid=00D1a000000L44R&s1nid=0DB2L000000k9dx&emkind=chatterCommentNotification&emvtk=x2W7r9XEfV7c024tXrrvI9Qer55WvJYpWEGiVUuizq4%3D&s1uid=0054z00000ANBCT&emtm=1650310269518&fromEmail=1&s1ext=0) UDN post and they replied that they’re planning to move tinyxml2 in the engine third party libraries with Unreal 5.1 release. It would then be possible to only include tinyxml once from the engine directory directly.

Thanks again for your feedback.

---

<div class="post-metadata">

**Author:** ![agallegos](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/agallegos/32/4464_2.png) [@agallegos](https://community.cesium.com/u/agallegos)\
**Post date:** [April 19, 2022, 1:38pm UTC](https://community.cesium.com/t/cannot-package-app/17911/7 "2022-04-19T13:38:28Z")

</div>

Hi @M003TSkyReal,

Thanks for following up! Glad to hear they’re working on it - I’ll update the team so that we can improve compatibility when Epic moves the library.

-Alex

---

<div class="post-metadata">

**Author:** ![aidnewsome](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/aidnewsome/32/12077_2.png) [@aidnewsome](https://community.cesium.com/u/aidnewsome)\
**Post date:** [January 26, 2023, 1:41am UTC](https://community.cesium.com/t/cannot-package-app/17911/8 "2023-01-26T01:41:54Z")

</div>

Do we know if this has been solved in 5.1? I’m having the same issue now.

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [January 26, 2023, 6:58am UTC](https://community.cesium.com/t/cannot-package-app/17911/9 "2023-01-26T06:58:32Z")

</div>

From one I can tell, tinyxml2 was not moved to the engine third party directory in UE 5.1. It’s still private to nDisplay.

---

<div class="post-metadata">

**Author:** ![aidnewsome](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/aidnewsome/32/12077_2.png) [@aidnewsome](https://community.cesium.com/u/aidnewsome)\
**Post date:** [January 26, 2023, 12:17pm UTC](https://community.cesium.com/t/cannot-package-app/17911/10 "2023-01-26T12:17:41Z")

</div>

Thank you for double checking. Is there any work around? I really need to package this project.

---

<div class="post-metadata">

**Author:** ![M003TSkyReal](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m003tskyreal/32/3476_2.png) [@M003TSkyReal](https://community.cesium.com/u/M003TSkyReal)\
**Post date:** [January 26, 2023, 1:21pm UTC](https://community.cesium.com/t/cannot-package-app/17911/11 "2023-01-26T13:21:07Z")

</div>

Hi, our team is also waiting for a way to package our app with cesium.

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [January 26, 2023, 11:59pm UTC](https://community.cesium.com/t/cannot-package-app/17911/12 "2023-01-26T23:59:31Z")

</div>

The only workaround - and I haven’t tried it - would be to make sure Cesium and nDisplay are using the exact same version of tinyxml2. It should be easy enough to recompile Cesium with any particular version, we just need to know which one nDisplay is using. And then hope some other Unreal plugin isn’t using yet another different version of tinyxml2. 😆

---

<div class="post-metadata">

**Author:** ![Andrew\_Gregg](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/andrew_gregg/32/12239_2.png) [@Andrew\_Gregg](https://community.cesium.com/u/Andrew_Gregg)\
**Post date:** [February 8, 2023, 7:47pm UTC](https://community.cesium.com/t/cannot-package-app/17911/13 "2023-02-08T19:47:19Z")

</div>

Hi Kevin, I’m also experiencing this issue. I have located the tinyxml2.lib files in the plugin directories of both ndisplay and Cesium on my computer…is there any way to determine which version is in use by ndisplay or try to get Cesium to link against it?

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [February 9, 2023, 3:37am UTC](https://community.cesium.com/t/cannot-package-app/17911/14 "2023-02-09T03:37:07Z")

</div>

We upgraded tinyxml2 in Cesium for Unreal v1.22, which was released last week. I’ve heard rumors that this fixes compatibility with nDisplay in UE5.1. Can you confirm? There’s a possibility that it simultaneously _broke_ compatibility with UE5.0, though.

---

<div class="post-metadata">

**Author:** ![Andrew\_Gregg](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/andrew_gregg/32/12239_2.png) [@Andrew\_Gregg](https://community.cesium.com/u/Andrew_Gregg)\
**Post date:** [February 10, 2023, 5:20am UTC](https://community.cesium.com/t/cannot-package-app/17911/15 "2023-02-10T05:20:05Z")

</div>

I upgraded my dev machine to both UE 5.1.1 and Cesium plugin v1.22.0 today, and I’m still getting the link error with tinyxml2.

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [February 10, 2023, 11:10am UTC](https://community.cesium.com/t/cannot-package-app/17911/16 "2023-02-10T11:10:19Z")

</div>

Ok, I just tried this out in UE 5.1.0. I started with the Cesium for Unreal Samples project, enabled the nDisplay plugin, and got the same tinyxml2 errors as you all. Here’s how you can work around it:

Open up `C:\Program Files\Epic Games\UE_5.1\Engine\Plugins\Marketplace\CesiumForUnreal\Source\CesiumRuntime\CesiumRuntime.Build.cs` and find the line with tinyxml2 on it. It’s line 99 in v1.22.0, but may be different in other versions. Just comment that line out. Like this:

```auto
        string[] libs = new string[]
        {
            "async++",
            "Cesium3DTilesSelection",
            "CesiumAsync",
            "CesiumGeometry",
            "CesiumGeospatial",
            "CesiumGltfReader",
            "CesiumGltf",
            "CesiumJsonReader",
            "CesiumUtility",
            "draco",
            "ktx_read",
            //"MikkTSpace",
            "modp_b64",
            "s2geometry",
            "spdlog",
            "sqlite3",
            //"tinyxml2",
            "uriparser",
            "webpdecoder",
            "ktx_read",
        };

```

Cesium will end up using nDisplay’s version of tinyxml2, which seems to be compatible enough to avoid the linker errors and not have any major problems at runtime.

Let me know how this works for you.

Kevin

---

<div class="post-metadata">

**Author:** ![Andrew\_Gregg](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/andrew_gregg/32/12239_2.png) [@Andrew\_Gregg](https://community.cesium.com/u/Andrew_Gregg)\
**Post date:** [February 12, 2023, 1:39am UTC](https://community.cesium.com/t/cannot-package-app/17911/17 "2023-02-12T01:39:50Z")

</div>

Success! Simple and straightforward for me. Thank you so much for your help on this.

---

<div class="post-metadata">

**Author:** ![restofpaul](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/restofpaul/32/13196_2.png) [@restofpaul](https://community.cesium.com/u/restofpaul)\
**Post date:** [April 11, 2023, 8:38pm UTC](https://community.cesium.com/t/cannot-package-app/17911/18 "2023-04-11T20:38:09Z")

</div>

To clarify on the solution - does that require re-compiling Cesium from source?

If it doesn’t, I’m stuck on this. I’m using Unreal 5.1 and building using VisualStudio 2022 and have seen the following:

- Compiles & Runs in the Unreal Editor using Cesium 1.22 - tinyxml2 NOT commented out
- Compiles and crashes in a cooked ‘DebugGame’ build - tinyxml2 NOT commented out
- Compiles but the Editor crashes when trying to load - tinyxml2 commented out.
- Same result using Cesium 1.23
- Cesium 1.24 - Fails to compile, complaining about these missing symbols: tjInitDecompress, tjDecompressHeader3, tjDecompress2, tjDestroy

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [May 2, 2023, 10:08am UTC](https://community.cesium.com/t/cannot-package-app/17911/19 "2023-05-02T10:08:49Z")

</div>

Are you compiling the plugin yourself? Or have you installed it from our GitHub releases page or from the Epic Marketplace?

---

<div class="post-metadata">

**Author:** ![M003TSkyReal](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/m003tskyreal/32/3476_2.png) [@M003TSkyReal](https://community.cesium.com/u/M003TSkyReal)\
**Post date:** [May 26, 2023, 2:41pm UTC](https://community.cesium.com/t/cannot-package-app/17911/20 "2023-05-26T14:41:51Z")

</div>

I went back to this, the easiest fix for us was to leave tinyxml included in Cesium only when Target.bBuildEditor is true, so that it is removed when building for shipping

[Next page](https://community.cesium.com/t/cannot-package-app/17911.md?page=2)
