Skip to content

Compilation failure on modern GCC (GCC 16+) due to missing <cstdint> in config.hpp #1

Description

@shahzaib4076

Describe the bug

When attempting to compile moss-transcribe.cpp on a fresh environment using a modern compiler (GCC 16.1.0 via MinGW/Ninja on Windows), the compilation fails at src/model_loader.cpp due to an unhandled template argument and undeclared types (int32_t). Modern GCC versions are much stricter with implicit header inclusions and no longer automatically pull in <cstdint> through other standard library files.

Error Log

[path/to/project]/src/config.hpp:21:17: error: 'int32_t' was not declared in this scope
   21 |      std::vector<int32_t> digit_token_ids; // 10 ids for "0".."9"
      |                  ^~~~~~~
[path/to/project]/src/config.hpp:4:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'

Environment

  • OS: Windows 11
  • Compiler: GCC 16.1.0 (MinGW-W64)
  • Build System: CMake + Ninja

Steps to Reproduce

  1. Clone the repository recursively.
  2. Configure the build: cmake -B build -G "Ninja" -DMT_BUILD_TESTS=ON
  3. Run the build step: cmake --build build -j

Suggested Fix

Explicitly include <cstdint> inside src/config.hpp. Adding #include <cstdint> right below #include <vector> fixes the compilation error entirely, allowing the project to compile and run tests successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions