CesiumGltfReader.h linking errors
When I #include <CesiumGltfReader/GltfReader.h> I get an error about async. I'm not using async at all.
[build] C:\Users\user\Desktop\EZVCPKG\2024.07.12\installed\x64-windows-static-md\include\async++/task.h(477): error C2187: syntax error: '::' was unexpected here [build] C:\Users\user\Desktop\EZVCPKG\2024.07.12\installed\x64-windows-static-md\include\async++/task.h(477): error C2955: 'async::task': use of class template requires template argument list [build] C:\Users\user\Desktop\EZVCPKG\2024.07.12\installed\x64-windows-static-md\include\async++/task.h(236): note: see declaration of 'async::task'
It autocompletes and links fine, I can link others like <CesiumGltfReader/ImageDecoder.h><CesiumGltfReader/Library.h> just fine. I haven't touched the async++/task.h at all its what was built with cmake for cesium-native. Any help would be appreciated.
@proximityeffect what version of C++ are you targetting? C++17? C++20? If you're using C++20, you should use the version of cesium-native from this branch: https://github.com/CesiumGS/cesium-native/pull/977
When GltfReader.h is included, it includes Material.h which also reports this error:
I'm using C++17 in a console project, I haven't included any windows headers, but somehow the macro is defined, causing compiler errors.
Tested on v0.41.0.
Managed to fix this by simply including CesiumGltf/Material.h before CesiumGltfReader/GltfReader.h 🤷♂️
I met this problem too! But I fix this. This macro pollution is due to the header WS2tcpip.h and WinSock2.h. So I just undef OPAQUE and before include WS2tcpip or something ( in my project is httplib.h), i def OPAQUE to 2.
Godot Cesium
https://github.com/Battle-Road-Labs/3D-Tiles-For-Godot/issues/84#issuecomment-2885610870