educelab / volume-cartographer

Volumetric processing toolkit and C++ libraries for the recovery and restoration of damaged cultural materials
GNU General Public License v3.0
63 stars 22 forks source link

[Bug] GCC 13 compilation error #73

Closed oceanusxiv closed 9 months ago

oceanusxiv commented 9 months ago

What happened?

It appears that GCC 13 started enforcing stricter adherence to the C++ standard and we now must include cstdint in order to have access to the builtin types. VC suffers from this issue in both its own codebase

In file included from /run/media/xxxx/work/vesuvius/volume-cartographer/build/core/Version.cpp:1:
/run/media/xxxx/work/vesuvius/volume-cartographer/core/include/vc/core/Version.hpp:19:35: error: ‘uint32_t’ does not name a type
   19 |     static auto VersionMajor() -> uint32_t;
      |                                   ^~~~~~~~
/run/media/xxxx/work/vesuvius/volume-cartographer/core/include/vc/core/Version.hpp:6:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    5 | #include <string>
  +++ |+#include <cstdint>

as well as in its smgl in-source dependency.

In file included from /run/media/xxxx/work/vesuvius/volume-cartographer/build/_deps/smgl-src/smgl/src/Uuid.cpp:1:
/run/media/xxxx/work/vesuvius/volume-cartographer/build/_deps/smgl-src/smgl/include/smgl/Uuid.hpp:20:18: error: ‘uint8_t’ does not name a type
   20 |     using Byte = uint8_t;
      |                  ^~~~~~~
/run/media/xxxx/work/vesuvius/volume-cartographer/build/_deps/smgl-src/smgl/include/smgl/Uuid.hpp:7:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    6 | #include <string>
  +++ |+#include <cstdint>
    7 | 

Steps to reproduce

  1. Install GCC 13 and make it the default compiler
  2. Follow the instructions in https://github.com/educelab/volume-cartographer?tab=readme-ov-file#compilation to build from source.

Version

HEAD

How did you install the software?

Built from source

On which operating systems have you experienced this issue?

Relevant log output

In file included from /run/media/xxxx/work/vesuvius/volume-cartographer/build/core/Version.cpp:1:
/run/media/xxxx/work/vesuvius/volume-cartographer/core/include/vc/core/Version.hpp:19:35: error: ‘uint32_t’ does not name a type
   19 |     static auto VersionMajor() -> uint32_t;
      |                                   ^~~~~~~~
/run/media/xxxx/work/vesuvius/volume-cartographer/core/include/vc/core/Version.hpp:6:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    5 | #include <string>
  +++ |+#include <cstdint>
In file included from /run/media/xxxx/work/vesuvius/volume-cartographer/build/_deps/smgl-src/smgl/src/Uuid.cpp:1:
/run/media/xxxx/work/vesuvius/volume-cartographer/build/_deps/smgl-src/smgl/include/smgl/Uuid.hpp:20:18: error: ‘uint8_t’ does not name a type
   20 |     using Byte = uint8_t;
      |                  ^~~~~~~
/run/media/xxxx/work/vesuvius/volume-cartographer/build/_deps/smgl-src/smgl/include/smgl/Uuid.hpp:7:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    6 | #include <string>
  +++ |+#include <cstdint>
    7 | 


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
csparker247 commented 9 months ago

Thanks for reporting. I've been slowly updating these instances as I've come across them, but since it wasn't causing compilation errors, I hadn't found them all yet. Should be a quick fix.