I am not able to package the project with #include <Cesium3DTileset.h>

When I try to use cesium3DTileset in c++. I able to build the project and functionality also works perfectly. But while packaging I am not able to package the project. I am getting the following errors.

C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Marketplace\Cesiumfo27e669801be6V8\Source\ThirdParty\include\CesiumGltf\AccessorUtility.h(356): error C4003: not enough arguments for function-like macro invocation 'max'
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Marketplace\Cesiumfo27e669801be6V8\Source\ThirdParty\include\CesiumGltf\AccessorUtility.h(357): error C4003: not enough arguments for function-like macro invocation 'max'
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Marketplace\Cesiumfo27e669801be6V8\Source\ThirdParty\include\CesiumGltf\AccessorUtility.h(356): error C2589: '(': illegal token on right side of '::'
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Marketplace\Cesiumfo27e669801be6V8\Source\ThirdParty\include\CesiumGltf\AccessorUtility.h(347): note: This diagnostic occurred in the compiler generated function 'std::optional<glm::dvec2> CesiumGltf::TexCoordFromAccessor::operator ()(const CesiumGltf::AccessorView<CesiumGltf::AccessorTypes::VEC2<T>> &)'
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Marketplace\Cesiumfo27e669801be6V8\Source\ThirdParty\include\CesiumGltf\AccessorUtility.h(356): error C3878: syntax error: unexpected token '(' following 'expression'
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Marketplace\Cesiumfo27e669801be6V8\Source\ThirdParty\include\CesiumGltf\AccessorUtility.h(347): note: This diagnostic occurred in the compiler generated function 'std::optional<glm::dvec2> CesiumGltf::TexCoordFromAccessor::operator ()(const CesiumGltf::AccessorView<CesiumGltf::AccessorTypes::VEC2<T>> &)'
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Marketplace\Cesiumfo27e669801be6V8\Source\ThirdParty\include\CesiumGltf\AccessorUtility.h(356): note: error recovery skipped: '( ('
UATHelper: Packaging (Windows): C:\Program Files\Epic Games\UE_5.5\Engine\Plugins\Marketplace\Cesiumfo27e669801be6V8\Source\ThirdParty\include\CesiumGltf\AccessorUtility.h(347): note: This diagnostic occurred in the compiler generated function 'std::optional<glm::dvec2> CesiumGltf::TexCoordFromAccessor::operator ()(const CesiumGltf::AccessorView<CesiumGltf::AccessorTypes::VEC2<T>> &)'
PackagingResults: Error: unexpected token '(' following 'expression'

Hi @Sumit_Das,

Errors like that are usually caused by including windows.h (or another Windows header) in a source file that also includes cesium-native headers. Unfortunately, windows.h defines macros for very common names such as max, which breaks a lot of code, including cesium-native.

One subtlety is that Unreal builds improve performance by dumping multiple sources files together at build time. So you may not actually be using both windows.h and a cesium-native header in the same source file, but then the Unreal Build Tool lumps them together anyway.

For the specific case of max, you should be able to fix this by adding #define NOMINMAX before the windows header file is included.