In file included from /root/O3DE/Gems/cesium-o3de/Code/Source/Cesium/Components/TilesetComponent.cpp:34:
In file included from /data/workspace/vendor/packages/CesiumNative/CesiumNative/include/Cesium3DTilesSelection/Tileset.h:19:
/data/workspace/vendor/packages/CesiumNative/CesiumNative/include/rapidjson/fwd.h:116:70: error: typedef redefinition with different types ('GenericValue<[...], MemoryPoolAllocator<>>' vs 'GenericValue<[...], (default) rapidjson_ly::CrtAllocator>')
typedef GenericValue<UTF8<char>, MemoryPoolAllocator<CrtAllocator> > Value;
^
/data/workspace/vendor/packages/CesiumNative/CesiumNative/include/rapidjson/document.h:2485:31: note: previous definition is here
typedef GenericValue<UTF8<> > Value;
^
In file included from /root/O3DE/Gems/cesium-o3de/Code/Source/Cesium/Components/TilesetComponent.cpp:34:
In file included from /data/workspace/vendor/packages/CesiumNative/CesiumNative/include/Cesium3DTilesSelection/Tileset.h:19:
/data/workspace/vendor/packages/CesiumNative/CesiumNative/include/rapidjson/fwd.h:121:86: error: typedef redefinition with different types ('GenericDocument<[...], MemoryPoolAllocator<>, [...]>' vs 'GenericDocument<[...], (default) rapidjson_ly::CrtAllocator, [...]>')
typedef GenericDocument<UTF8<char>, MemoryPoolAllocator<CrtAllocator>, CrtAllocator> Document;
^
/data/workspace/vendor/packages/CesiumNative/CesiumNative/include/rapidjson/document.h:2889:34: note: previous definition is here
typedef GenericDocument<UTF8<> > Document;
^
2 errors generated.
As a workaround, one can apply the following patch to the CesiumNative package in the .o3de/3rdparty/packages/CesiumNative/CesiumNative/include/rapidjson folder:
A proper fix should however either fix the problem in CesiumNative or make the clang compiler accept the typedef redefinition with different types of rapidjson.
When trying to compile Cesium O3DE on 22.10 / development, e.g. via https://github.com/CesiumGS/cesium-o3de/pull/45 or https://github.com/CesiumGS/cesium-o3de/pull/50, the compilation will fail with the following error message:
As a workaround, one can apply the following patch to the CesiumNative package in the
.o3de/3rdparty/packages/CesiumNative/CesiumNative/include/rapidjson
folder:A proper fix should however either fix the problem in CesiumNative or make the clang compiler accept the
typedef redefinition with different types
of rapidjson.