Build errors "error: expected ';' before '_Bool'"


marko.panger@...
 
Edited

Hi, I've been building and using Zephyr with success so far. While adding *.c files and include paths to my project the build stared to fail at some point. It looks like "bool" is not defined withing Zephyr when building it. I'm copy pasting the offending part my build output. I've been trying to play around with including stdbool.h in my project, but the issue seems to be how the Zephyr build system stages the build. I'm no expert in this so bear with me.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/markopa/Projects/wm-fork/wm-zephyr/build
-- west build: building application
cmake version 3.16.3 is OK; minimum version is 3.13.1
Running CMake: /usr/bin/cmake --build /home/markopa/Projects/wm-fork/wm-zephyr/build -- -v
[1/190] cd /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr && /usr/bin/python3.8 /home/markopa/Projects/wm-fork/zephyr/scripts/parse_syscalls.py --include /home/markopa/Projects/wm-fork/zephyr/include --include /home/markopa/Projects/wm-fork/zephyr/drivers --include /home/markopa/Projects/wm-fork/zephyr/subsys/net --json-file /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr/misc/generated/syscalls.json --tag-struct-file /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr/misc/generated/struct_tags.json
[2/190] /home/markopa/zephyr-sdk-0.12.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=v2.6.0-rc1-ncs1 -DKERNEL -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/markopa/Projects/wm-fork/zephyr/kernel/include -I/home/markopa/Projects/wm-fork/zephyr/arch/arm/include -I/home/markopa/Projects/wm-fork/nrf/drivers/mpsl/clock_control -I/home/markopa/Projects/wm-fork/zephyr/include -Izephyr/include/generated -I/home/markopa/Projects/wm-fork/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/markopa/Projects/wm-fork/zephyr/lib/libc/newlib/include -I/home/markopa/Projects/wm-fork/zephyr/subsys/bluetooth -I/home/markopa/Projects/wm-fork/nrf/include -I/home/markopa/Projects/wm-fork/nrf/lib/multithreading_lock/. -I/home/markopa/Projects/wm-fork/nrf/subsys/bluetooth/controller/. -I/home/markopa/Projects/wm-fork/modules/hal/cmsis/CMSIS/Core/Include -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx/drivers/include -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx/mdk -I/home/markopa/Projects/wm-fork/zephyr/modules/hal_nordic/nrfx/. -I/home/markopa/Projects/wm-fork/modules/crypto/tinycrypt/lib/include -I/home/markopa/Projects/wm-fork/nrfxlib/mpsl/include -I/home/markopa/Projects/wm-fork/nrfxlib/softdevice_controller/include -isystem /home/markopa/Projects/wm-fork/nrfxlib/crypto/nrf_cc310_platform/include -Os -imacros /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -imacros /home/markopa/Projects/wm-fork/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/markopa/Projects/wm-fork/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/markopa/Projects/wm-fork=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -MF zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj.d -o zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -c /home/markopa/Projects/wm-fork/zephyr/arch/arm/core/offsets/offsets.c
[3/190] cd /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr && /usr/bin/python3.8 /home/markopa/Projects/wm-fork/zephyr/scripts/gen_offset_header.py -i /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -o /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr/include/generated/offsets.h
[4/190] /home/markopa/zephyr-sdk-0.12.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=v2.6.0-rc1-ncs1 -DCNSL_PWD=\"\" -DKERNEL -DNRF52840_XXAA -DNRF52_SERIES -DQP_API_VERSION=691 -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/inc -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/./components/generated -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../qpc_6.9.2/src -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../qpc_6.9.2/include -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../qpc_6.9.2/ports/zephyr -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/.. -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../components -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../components/generated -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/cbet/CBET/dec -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/mqttsn -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/mqttsn/packets -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/fft/FFT -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/dbspl -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../NordicMeshSDK/mesh/core/api -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../NordicMeshSDK/mesh/core/include -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../NordicMeshSDK/mesh/bearer/api -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../NordicMeshSDK/mesh/bearer/include -I/home/markopa/Projects/wm-fork/nrf/drivers/mpsl/clock_control -I/home/markopa/Projects/wm-fork/zephyr/include -Izephyr/include/generated -I/home/markopa/Projects/wm-fork/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/markopa/Projects/wm-fork/zephyr/lib/libc/newlib/include -I/home/markopa/Projects/wm-fork/zephyr/subsys/bluetooth -I/home/markopa/Projects/wm-fork/nrf/include -I/home/markopa/Projects/wm-fork/nrf/lib/multithreading_lock/. -I/home/markopa/Projects/wm-fork/nrf/subsys/bluetooth/controller/. -I/home/markopa/Projects/wm-fork/modules/hal/cmsis/CMSIS/Core/Include -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx/drivers/include -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx/mdk -I/home/markopa/Projects/wm-fork/zephyr/modules/hal_nordic/nrfx/. -I/home/markopa/Projects/wm-fork/modules/crypto/tinycrypt/lib/include -I/home/markopa/Projects/wm-fork/nrfxlib/mpsl/include -I/home/markopa/Projects/wm-fork/nrfxlib/softdevice_controller/include -isystem /home/markopa/Projects/wm-fork/nrfxlib/crypto/nrf_cc310_platform/include -Os -imacros /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -imacros /home/markopa/Projects/wm-fork/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/markopa/Projects/wm-fork/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/markopa/Projects/wm-fork=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT CMakeFiles/app.dir/home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c.obj -MF CMakeFiles/app.dir/home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c.obj.d -o CMakeFiles/app.dir/home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c.obj -c /home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c
FAILED: CMakeFiles/app.dir/home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c.obj
/home/markopa/zephyr-sdk-0.12.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=v2.6.0-rc1-ncs1 -DCNSL_PWD=\"\" -DKERNEL -DNRF52840_XXAA -DNRF52_SERIES -DQP_API_VERSION=691 -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/inc -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/./components/generated -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../qpc_6.9.2/src -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../qpc_6.9.2/include -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../qpc_6.9.2/ports/zephyr -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/.. -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../components -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../components/generated -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/cbet/CBET/dec -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/mqttsn -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/mqttsn/packets -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/fft/FFT -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../libs/dbspl -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../NordicMeshSDK/mesh/core/api -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../NordicMeshSDK/mesh/core/include -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../NordicMeshSDK/mesh/bearer/api -I/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../NordicMeshSDK/mesh/bearer/include -I/home/markopa/Projects/wm-fork/nrf/drivers/mpsl/clock_control -I/home/markopa/Projects/wm-fork/zephyr/include -Izephyr/include/generated -I/home/markopa/Projects/wm-fork/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/markopa/Projects/wm-fork/zephyr/lib/libc/newlib/include -I/home/markopa/Projects/wm-fork/zephyr/subsys/bluetooth -I/home/markopa/Projects/wm-fork/nrf/include -I/home/markopa/Projects/wm-fork/nrf/lib/multithreading_lock/. -I/home/markopa/Projects/wm-fork/nrf/subsys/bluetooth/controller/. -I/home/markopa/Projects/wm-fork/modules/hal/cmsis/CMSIS/Core/Include -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx/drivers/include -I/home/markopa/Projects/wm-fork/modules/hal/nordic/nrfx/mdk -I/home/markopa/Projects/wm-fork/zephyr/modules/hal_nordic/nrfx/. -I/home/markopa/Projects/wm-fork/modules/crypto/tinycrypt/lib/include -I/home/markopa/Projects/wm-fork/nrfxlib/mpsl/include -I/home/markopa/Projects/wm-fork/nrfxlib/softdevice_controller/include -isystem /home/markopa/Projects/wm-fork/nrfxlib/crypto/nrf_cc310_platform/include -Os -imacros /home/markopa/Projects/wm-fork/wm-zephyr/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -imacros /home/markopa/Projects/wm-fork/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/markopa/Projects/wm-fork/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/markopa/Projects/wm-fork=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT CMakeFiles/app.dir/home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c.obj -MF CMakeFiles/app.dir/home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c.obj.d -o CMakeFiles/app.dir/home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c.obj -c /home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c
In file included from /home/markopa/Projects/wm-fork/zephyr/include/kernel_includes.h:31,
from /home/markopa/Projects/wm-fork/zephyr/include/kernel.h:17,
from /home/markopa/Projects/wm-fork/zephyr/include/zephyr.h:18,
from /home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../qpc_6.9.2/ports/zephyr/qf_port.h:5,
from /home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c:41:
/home/markopa/Projects/wm-fork/zephyr/include/syscall.h:93:21: error: expected ';' before '_Bool'
93 | static ALWAYS_INLINE bool z_syscall_trap(void)
| ^
| ;
In file included from /home/markopa/Projects/wm-fork/zephyr/include/kernel_includes.h:32,
from /home/markopa/Projects/wm-fork/zephyr/include/kernel.h:17,
from /home/markopa/Projects/wm-fork/zephyr/include/zephyr.h:18,
from /home/markopa/Projects/wm-fork/wm-zephyr/bsp_wm_zephyr/../qpc_6.9.2/ports/zephyr/qf_port.h:5,
from /home/markopa/Projects/wm-fork/wm-zephyr/qpc_6.9.2/src/qf/qf_ps.c:41:
/home/markopa/Projects/wm-fork/zephyr/include/sys/printk.h:59:22: error: expected declaration specifiers or '...' before numeric constant
59 | extern __printf_like(1, 2) void printk(const char *fmt, ...);

Join users@lists.zephyrproject.org to automatically receive all group messages.