CesiumGltf/Material.h error

I included in my project #include “Cesium3DTileset.h” results cesiumGltf/Material.h errors

If I remove #include “Cesium3DTileset.h”, it would be fine

Hi @fonlylovey,

Most likely your source file is also including a Windows header file, like windows.h or wingdi.h. Windows header files are notorious for #define’ing common words, such as MIN, MAX, and OPAQUE, causing any code that uses these names (even when properly namespaced as ours are) to break in weird ways.

Best practice is to isolate your code that interacts with Windows into source files that include as little else as possible. And then call those isolated bits of code from other functions that interact with the rest of the world.

If you can’t do that, you may be able to undefine the conflicting symbols before including Cesium for Unreal headers, e.g.

#undef OPAQUE
#include “Cesium3DTileset.h”


thx, very