CesiumGS / cesium-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error building in Arch Linux

samtux opened this issue · comments

In the Platform: x86_64 Arch Linux, GCC v13.2.1, clang v16.0.6, cmake v3.27.8.

I get the next error building in Arch Linux:

[ 25%] Built target Async++
[ 26%] Built target sqlite3
[ 26%] Building CXX object CesiumAsync/CMakeFiles/CesiumAsync.dir/src/SqliteCache.cpp.o
In file included from /home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/ICacheDatabase.h:3,
                 from /home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/SqliteCache.h:3,
                 from /home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/src/SqliteCache.cpp:1:
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:27:15: error: expected ')' before 'cacheStatusCode'
   27 |       uint16_t cacheStatusCode,
      |               ^~~~~~~~~~~~~~~~
      |               )
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:26:16: note: to match this '('
   26 |   CacheResponse(
      |                ^
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:37:3: error: 'uint16_t' does not name a type
   37 |   uint16_t statusCode;
      |   ^~~~~~~~
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:12:1: note: 'uint16_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   11 | #include <vector>
  +++ |+#include <cstdint>
   12 | 
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/ICacheDatabase.h:52:7: error: 'uint16_t' has not been declared
   52 |       uint16_t statusCode,
      |       ^~~~~~~~
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/SqliteCache.h:42:16: error: 'virtual bool CesiumAsync::SqliteCache::storeEntry(const std::string&, time_t, const std::string&, const std::string&, const CesiumAsync::HttpHeaders&, uint16_t, const CesiumAsync::HttpHeaders&, const gsl::span<const std::byte>&)' marked 'override', but does not override
   42 |   virtual bool storeEntry(
      |                ^~~~~~~~~~
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/src/SqliteCache.cpp: In member function 'virtual std::optional<CesiumAsync::CacheItem> CesiumAsync::SqliteCache::getEntry(const std::string&) const':
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/src/SqliteCache.cpp:454:34: error: too many initializers for 'CesiumAsync::CacheResponse'
  454 |           std::move(responseData)}};
      |                                  ^
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/src/SqliteCache.cpp:454:35: error: no matching function for call to 'CesiumAsync::CacheItem::CacheItem(<brace-enclosed initializer list>)'
  454 |           std::move(responseData)}};
      |                                   ^
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:96:3: note: candidate: 'CesiumAsync::CacheItem::CacheItem(time_t, CesiumAsync::CacheRequest&&, CesiumAsync::CacheResponse&&)'
   96 |   CacheItem(
      |   ^~~~~~~~~
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:96:3: note:   conversion of argument 3 would be ill-formed:
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:88:23: note: candidate: 'CesiumAsync::CacheItem::CacheItem(const CesiumAsync::CacheItem&)'
   88 | class CESIUMASYNC_API CacheItem {
      |                       ^~~~~~~~~
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:88:23: note:   candidate expects 1 argument, 3 provided
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:88:23: note: candidate: 'CesiumAsync::CacheItem::CacheItem(CesiumAsync::CacheItem&&)'
/home/smesa/makepkg/cesium-native/cesium-native/CesiumAsync/include/CesiumAsync/CacheItem.h:88:23: note:   candidate expects 1 argument, 3 provided
make[2]: *** [CesiumAsync/CMakeFiles/CesiumAsync.dir/build.make:174: CesiumAsync/CMakeFiles/CesiumAsync.dir/src/SqliteCache.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3306: CesiumAsync/CMakeFiles/CesiumAsync.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

The solution is in the error message: add #include <cstdint> to the top of the file. Other compilers seem to be ok without it, but it should be there. We welcome a pull request with this change if it works for you.

@kring There's also a similar error when building draco. It has recently been fixed, in this PR: https://github.com/google/draco/pull/964/files

Would it also be an option to update the Draco submodule?

Would it also be an option to update the Draco submodule?

Yes, we'd welcome a pull request to update the Draco submodule as well.