Skip to content

Fix build: Add missing include for C bool type.#78

Merged
chemicstry merged 1 commit into
lit-robotics:mainfrom
hzeller:feature-20260102-add-missing-include
Jan 2, 2026
Merged

Fix build: Add missing include for C bool type.#78
chemicstry merged 1 commit into
lit-robotics:mainfrom
hzeller:feature-20260102-add-missing-include

Conversation

@hzeller

@hzeller hzeller commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

Unlike C++, bool is not a built-in type in C, so requires the <stdbool.h> header.

Fxes a build-error:

  ./c_api/pixel_format.h:37:1: error: unknown type name 'bool'

  thread 'main' (165738) panicked at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libcamera-sys-0.6.0/build.rs:76:39:
  Unable to generate bindings: ClangDiagnostic("./c_api/pixel_format.h:37:1: error: unknown type name 'bool'\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Unlike C++, `bool` is not a built-in type in C, so requires the
`<stdbool.h>` header.

Fxes a build-error:

```
  ./c_api/pixel_format.h:37:1: error: unknown type name 'bool'

  thread 'main' (165738) panicked at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libcamera-sys-0.6.0/build.rs:76:39:
  Unable to generate bindings: ClangDiagnostic("./c_api/pixel_format.h:37:1: error: unknown type name 'bool'\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

Signed-off-by: Henner Zeller <h.zeller@acm.org>
@chemicstry

Copy link
Copy Markdown
Contributor

This probably depends on compiler version, because it built fine on my machine and on CI. Thanks!

@chemicstry chemicstry merged commit f480fb8 into lit-robotics:main Jan 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants