hello_world will not compile

I'm trying to compile hello_world from the template files on the nRF9160-DK.

My computer is running Ubuntu 22.04.02. I have updated everything via nRF Connect for Desktop v4.1.2.

I am using VSCode and used the "Build" button in the Actions box.

Here is the code:

/*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/kernel.h>

void main(void)
{

printk("Hello World! %s\n", CONFIG_BOARD);

}

Here is the message in the TERMINAL window of VSCode

Building hello_world_July_18_23
/bin/sh -c west build --build-dir /nordicsemi/myapps/hello_world_July_18_23/build /nordicsemi/myapps/hello_world_July_18_23

[0/24] Performing build step for 'tfm'
ninja: no work to do.
[2/16] Building C object CMakeFiles/app.dir/src/main.c.obj
[3/16] Linking C static library app/libapp.a
[4/16] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
FAILED: zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj
ccache /nordicsemi/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_USER_CONFIG_FILE=\"nrf-config-user.h\" -DNRF9160_XXAA -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DUSE_PARTITION_MANAGER=1 -D_ANSI_SOURCE -D_FORTIFY_SOURCE=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/nordicsemi/v2.3.0/zephyr/include -Izephyr/include/generated -I/nordicsemi/v2.3.0/zephyr/soc/arm/nordic_nrf/nrf91 -I/nordicsemi/v2.3.0/zephyr/lib/libc/newlib/include -I/nordicsemi/v2.3.0/zephyr/soc/arm/nordic_nrf/common/. -I/nordicsemi/v2.3.0/nrf/include -I/nordicsemi/v2.3.0/nrf/include/tfm -I/nordicsemi/v2.3.0/nrf/tests/include -Itfm/generated/interface/include -I/nordicsemi/v2.3.0/modules/hal/cmsis/CMSIS/Core/Include -I/nordicsemi/v2.3.0/modules/hal/nordic/nrfx -I/nordicsemi/v2.3.0/modules/hal/nordic/nrfx/drivers/include -I/nordicsemi/v2.3.0/modules/hal/nordic/nrfx/mdk -I/nordicsemi/v2.3.0/zephyr/modules/hal_nordic/nrfx/. -I/nordicsemi/v2.3.0/nrfxlib/nrf_modem/include -Itfm/install/interface/include -Imodules/nrfxlib/nrfxlib/nrf_security/src/include/generated -I/nordicsemi/v2.3.0/nrfxlib/nrf_security/include -I/nordicsemi/v2.3.0/nrfxlib/nrf_security/include/mbedtls -I/nordicsemi/v2.3.0/modules/crypto/mbedtls/include -I/nordicsemi/v2.3.0/modules/crypto/mbedtls/include/mbedtls -I/nordicsemi/v2.3.0/modules/crypto/mbedtls/include/psa -I/nordicsemi/v2.3.0/modules/crypto/mbedtls/library -I/nordicsemi/v2.3.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -I/nordicsemi/v2.3.0/nrfxlib/crypto/nrf_oberon/include -fno-strict-aliasing -Os -imacros /nordicsemi/myapps/hello_world_July_18_23/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=/nordicsemi/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros /nordicsemi/v2.3.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/nordicsemi/myapps/hello_world_July_18_23=CMAKE_SOURCE_DIR -fmacro-prefix-map=/nordicsemi/v2.3.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/nordicsemi/v2.3.0=WEST_TOPDIR -ffunction-sections -fdata-sections -specs=nano.specs -std=c99 -MD -MT zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj -MF zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj.d -o zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj -c /nordicsemi/v2.3.0/zephyr/drivers/serial/uart_nrfx_uarte.c
In file included from /nordicsemi/v2.3.0/zephyr/drivers/serial/uart_nrfx_uarte.c:13:
/nordicsemi/v2.3.0/modules/hal/nordic/nrfx/hal/nrf_uarte.h: In function 'nrf_uarte_event_check':
/nordicsemi/v2.3.0/modules/hal/nordic/nrfx/hal/nrf_uarte.h:489:1: error: unknown type name 'namespace'
489 | namespace n
| ^~~~~~~~~
/nordicsemi/v2.3.0/modules/hal/nordic/nrfx/hal/nrf_uarte.h:491:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
491 | {
| ^
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /nordicsemi/toolchains/v2.3.0/usr/local/bin/cmake --build /nordicsemi/myapps/hello_world_July_18_23/build

* The terminal process failed to launch (exit code: 1).
* Terminal will be reused by tasks, press any key to close it.

Related