Fatal error: stdbool.h: No such file or directory #include <stdbool.h>

Good Morning Team. This is my first post and am so excited.

I am trying to compile DAHDI on Rocky Linux.

$ cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.1 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.1"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.1 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.1"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.1"

The kernel version is :

$ uname -r
5.14.0-162.23.1.el9_1.x86_64

When I try to compile Dahdi on my box, I get the fatal error.

$ cd /usr/local/src/
$ cd dahdi-linux-complete-3.2.0+3.2.0/
$ sudo make
[sudo] password for jil:
make -C linux all
make[1]: Entering directory '/usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux'
make -C drivers/dahdi/firmware firmware-loaders
make[2]: Entering directory '/usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/firmware'
make[2]: Leaving directory '/usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/firmware'
make -C /lib/modules/5.14.0-162.23.1.el9_1.x86_64/build M=/usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi DAHDI_INCLUDE=/usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/include DAHDI_MODULES_EXTRA=" " HOTPLUG_FIRMWARE=yes modules DAHDI_BUILD_ALL=m
make[2]: Entering directory '/usr/src/kernels/5.14.0-162.23.1.el9_1.x86_64'
  CC [M]  /usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.o
/usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.c:47:10: fatal error: stdbool.h: No such file or directory
   **47 | #include <stdbool.h>**
      |          ^~~~~~~~~~~
compilation terminated.
make[4]: *** [scripts/Makefile.build:295: /usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp/base.o] Error 1
make[3]: *** [scripts/Makefile.build:574: /usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi/wctc4xxp] Error 2
make[2]: *** [Makefile:1915: /usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux/drivers/dahdi] Error 2
make[2]: Leaving directory '/usr/src/kernels/5.14.0-162.23.1.el9_1.x86_64'
make[1]: *** [Makefile:74: modules] Error 2
make[1]: Leaving directory '/usr/local/src/dahdi-linux-complete-3.2.0+3.2.0/linux'
make: *** [Makefile:9: all] Error 2
[jil@asterisk dahdi-linux-complete-3.2.0+3.2.0]$

I then run the command below:

dnf provides */stdbool.h

Which provides a long list. I narrow it down with

$ dnf list *dahdi*
Last metadata expiration check: 0:00:36 ago on Thu 18 May 2023 09:56:38 PM EAT.
Available Packages
asterisk-dahdi.x86_64                     18.12.1-1.el9.1                   epel
dahdi-tools.x86_64                        2.11.1-28.el9                     epel
dahdi-tools-devel.x86_64                  2.11.1-28.el9                     epel
dahdi-tools-libs.x86_64                   2.11.1-28.el9                     epel

Please show me how to address this header issue. Thank you.

The header file should be already on your machine. find /usr -name stdbool.h should list it for each compiler you have installed (e.g. gcc, clang, …).

If it is found, but make failes, then there could be a problem with the configuration of the C compiler.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.