Skip to content

Compilation failure: Missing <cstdint> in ChatMessage.h and <unistd.h> in testMutex.cpp #3019

Description

@Wabuo

Description

Compilation fails when building the engine with strict or modern toolchains due to missing explicit header inclusions.

Specifically, macro definitions like UINT8_MAX and POSIX system call primitives are missing their required standard headers, leading to "not declared in this scope" compiler errors when transitive dependencies are cleaned up by the preprocessor.

Environment

  • OS: Linux (Arch Linux / CachyOS)
  • Compiler: GCC (utilizing default Arch Linux packaging configurations)
  • Component: recoil-engine-rc core engine and test suite

Missing Headers Detail

1. Missing <cstdint> in rts/Game/ChatMessage.h

The header file references UINT8_MAX but does not explicitly include <cstdint>. In environments where other included headers no longer transitively expose standard integer limits, compilation fails.

  • Affected File: rts/Game/ChatMessage.h
  • Required Fix: Include <cstdint> before using fixed-width integer max macros.

2. Missing <unistd.h> in test/other/testMutex.cpp

The test suite utility utilizes low-level Linux/POSIX system calls or standard execution constants but lacks the fundamental standard symbolic constants header.

  • Affected File: test/other/testMutex.cpp
  • Required Fix: Include <unistd.h> at the top of the file to supply the necessary declarations for Linux syscall environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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