Skip to content

MinGW / no-HIDAPI build broken: unguarded TMate2Overlay calls in applyFlexControlWheelAction #3435

@NF0T

Description

@NF0T

What happened?

PR #3401 (ELAD/WoodBoxRadio TMate 2 USB HID support) added calls to
triggerTMate2Overlay(TMate2Overlay::...) inside applyFlexControlWheelAction.
applyFlexControlWheelAction is declared outside any #ifdef HAVE_HIDAPI block —
it handles wheel inputs from FlexControl, MIDI, and other non-HID sources — but
both TMate2Overlay (an enum class) and triggerTMate2Overlay are declared
inside the #ifdef HAVE_HIDAPI block in MainWindow.h (lines 573–623). The
five unguarded call sites cause a build failure on any configuration where
HIDAPI is not present.

Compiler output (MinGW GCC 13.1.0, Qt 6.11.0, no hidapi):

src/gui/MainWindow.cpp:7823:34: error: 'TMate2Overlay' has not been declared
src/gui/MainWindow.cpp:7823:13: error: 'triggerTMate2Overlay' was not declared in this scope
src/gui/MainWindow.cpp:7840:30: error: 'TMate2Overlay' has not been declared
... (5 sites total)

This does not reproduce on CI because the Docker image and MSVC Windows path
both include HIDAPI. It only surfaces locally on Windows without
scripts/setup/setup-hidapi.ps1 having been run, or on Linux/macOS builds
where the HID optional dependency was not installed.

Steps to reproduce

  1. Clone the repo on Windows without running setup-hidapi.ps1
  2. Configure and build normally
  3. Observe compile failure in MainWindow.cpp

Expected behavior

Build succeeds on all target platforms regardless of HIDAPI availability,
matching the pattern established in PR #3344.

Affected lines

src/gui/MainWindow.cpp — five call sites inside applyFlexControlWheelAction:
WheelRit (×1), WheelVolume (×2), WheelPower (×1), WheelCwSpeed (×1).

Fix

Wrap each of the five sites with #ifdef HAVE_HIDAPI / #endif.
Branch fix/tmate2-wheel-mingw-no-hidapi on NF0T/AetherSDR has the patch
ready for PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIUser interfacebugSomething isn't workingexternal devicesFlexControl, MIDI, serial port, USB peripheralsgood first issueGood for newcomersmaintainer-reviewRequires maintainer review before any action is taken

    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