Can't compile C++ projects for PicoSystem

I’ve installed the build tools and SDK for PicoSystem on a Pi 4 but when I try to build the examples or the boilerplate template I get this error

/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate ‘inline’
#define __force_inline inline __always_inline

The first _ of __always_inline is shown in red with a red ^ pointing at it

I also get this message but it doesn’t say it’s an error

/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:93:8: note: in expansion of macro ‘__force_inline’
static __force_inline uint32_t xip_alias_check_addr(const void *addr) {
The __force_inline and the ^~~~~~~~~~~ under it are shown in pale blue

I bought a new microSD and installed a fresh copy of the OS, desktop version without the recommended extras. Building the examples works on this so there must have been a conflict with something else I’ve got installed on my working setup.