hel
November 11, 2021, 9:44am
21
I updated the Getting Started with C++ tutorial earlier this week so the build instructions in there should be current - they worked OK for me on a Pi, anyway.
There have been significant changes to the Picosystem libraries over the last month or so, so if it’s not playing it might be worth starting from scratch with a new Pi OS image in case you’ve got an old or broken version of the Pico SDK or the Picosystem SDK lurking somewhere and causing problems? At the very least, it’s worth getting rid of any directories you’ve tried to build into unsuccessfully as these can cause cmake to fail in mysterious ways.
The folks on the 32blit discord might be able to to help if you’re struggling with the C++ buildchain, they are cmake ninjas :)
Thanks, I have not tried again since Monday. I’ll try the install ASAP and let you know how it goes.
Brian
1 Like
I created a new Pi OS SD card and booted from it and the “Getting Started with C++ tutorial” worked I am using Twister OS for my Pi and have a really nice setup with lots of tools and utilities.
So then I tried a fresh Twister OS SD card boot to make sure there wasn’t something wrong with my OS, and the “Getting Started with C++ tutorial” failed so it doesn’t like something about Twister OS the weird thing is an older version of your SDK that I used at first worked just fine until you updated the SDK and now it doesn’t.
Is it possible to take a look at this to see what might be happening - why the SDK isn’t working with Twister OS.
Thanks,
Brian
hel
November 12, 2021, 11:34am
24
Glad to hear that it worked OK with Pi OS, phew :)
I’ve not had anything to do with Twister OS I’m afraid - what build errors are you getting? Can you build the Pico SDK examples? (Instructions on how to do that are from page 6 onwards of the Pico Getting Started ). Might be worth trying sudo apt install
ing the extra toolchain packages mentioned on page 7, in case they’re not included by default?
Does this mean anything to you, this is what I get when I try to compile the examples:
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:282:1: note: in expansion of macro '__force_inline'
__force_inline static void __compiler_memory_barrier(void) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:347:8: note: in expansion of macro '__force_inline'
static __force_inline void tight_loop_contents(void) {}
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:359:1: note: in expansion of macro '__force_inline'
__force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/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) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:121:1: note: in expansion of macro '__force_inline'
__force_inline static void hw_set_bits(io_rw_32 *addr, uint32_t mask) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:131:1: note: in expansion of macro '__force_inline'
__force_inline static void hw_clear_bits(io_rw_32 *addr, uint32_t mask) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:141:1: note: in expansion of macro '__force_inline'
__force_inline static void hw_xor_bits(io_rw_32 *addr, uint32_t mask) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:157:1: note: in expansion of macro '__force_inline'
__force_inline static void hw_write_masked(io_rw_32 *addr, uint32_t values, uint32_t write_mask) {
^~~~~~~~~~~~~~
make[2]: *** [examples/snake/CMakeFiles/snake.dir/build.make:63: examples/snake/CMakeFiles/snake.dir/snake.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:1932: examples/snake/CMakeFiles/snake.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Here’s what I get if I try to compile the ourproject example:
pretty much the same thing :(
Scanning dependencies of target ELF2UF2Build
[ 1%] Creating directories for 'ELF2UF2Build'
[ 2%] No download step for 'ELF2UF2Build'
[ 3%] No patch step for 'ELF2UF2Build'
[ 4%] No update step for 'ELF2UF2Build'
[ 6%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/ourproject/build/elf2uf2
[ 7%] Performing build step for 'ELF2UF2Build'
Scanning dependencies of target elf2uf2
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.o
[100%] Linking CXX executable elf2uf2
[100%] Built target elf2uf2
[ 8%] No install step for 'ELF2UF2Build'
[ 9%] Completed 'ELF2UF2Build'
[ 9%] Built target ELF2UF2Build
Scanning dependencies of target bs2_default
[ 10%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj
[ 12%] Linking ASM executable bs2_default.elf
[ 12%] Built target bs2_default
Scanning dependencies of target bs2_default_padded_checksummed_asm
[ 13%] Generating bs2_default.bin
[ 14%] Generating bs2_default_padded_checksummed.S
[ 14%] Built target bs2_default_padded_checksummed_asm
Scanning dependencies of target PioasmBuild
[ 15%] Creating directories for 'PioasmBuild'
[ 16%] No download step for 'PioasmBuild'
[ 18%] No patch step for 'PioasmBuild'
[ 19%] No update step for 'PioasmBuild'
[ 20%] Performing configure step for 'PioasmBuild'
-- The CXX compiler identification is GNU 8.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/ourproject/build/pioasm
[ 21%] Performing build step for 'PioasmBuild'
Scanning dependencies of target pioasm
[ 10%] Building CXX object CMakeFiles/pioasm.dir/main.cpp.o
[ 20%] Building CXX object CMakeFiles/pioasm.dir/pio_assembler.cpp.o
[ 30%] Building CXX object CMakeFiles/pioasm.dir/pio_disassembler.cpp.o
[ 40%] Building CXX object CMakeFiles/pioasm.dir/gen/lexer.cpp.o
[ 50%] Building CXX object CMakeFiles/pioasm.dir/gen/parser.cpp.o
[ 60%] Building CXX object CMakeFiles/pioasm.dir/c_sdk_output.cpp.o
[ 70%] Building CXX object CMakeFiles/pioasm.dir/python_output.cpp.o
[ 80%] Building CXX object CMakeFiles/pioasm.dir/hex_output.cpp.o
[ 90%] Building CXX object CMakeFiles/pioasm.dir/ada_output.cpp.o
[100%] Linking CXX executable pioasm
[100%] Built target pioasm
[ 22%] No install step for 'PioasmBuild'
[ 24%] Completed 'PioasmBuild'
[ 24%] Built target PioasmBuild
Scanning dependencies of target picosystem_screen_pio_h
[ 25%] Generating screen.pio.h
[ 25%] Built target picosystem_screen_pio_h
Scanning dependencies of target picosystem_screen_double_pio_h
[ 26%] Generating screen_double.pio.h
[ 26%] Built target picosystem_screen_double_pio_h
Scanning dependencies of target my_project
[ 27%] Building CXX object CMakeFiles/my_project.dir/main.cpp.obj
In file included from /usr/include/newlib/wchar.h:16:0,
from /usr/include/newlib/c++/7.3.1/cwchar:44,
from /usr/include/newlib/c++/7.3.1/bits/postypes.h:40,
from /usr/include/newlib/c++/7.3.1/iosfwd:40,
from /usr/include/newlib/c++/7.3.1/memory:72,
from /home/pi/picosystem/libraries/picosystem.hpp:3,
from /home/pi/ourproject/main.cpp:1:
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:282:1: note: in expansion of macro '__force_inline'
__force_inline static void __compiler_memory_barrier(void) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:347:8: note: in expansion of macro '__force_inline'
static __force_inline void tight_loop_contents(void) {}
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:359:1: note: in expansion of macro '__force_inline'
__force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/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) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:121:1: note: in expansion of macro '__force_inline'
__force_inline static void hw_set_bits(io_rw_32 *addr, uint32_t mask) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:131:1: note: in expansion of macro '__force_inline'
__force_inline static void hw_clear_bits(io_rw_32 *addr, uint32_t mask) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:141:1: note: in expansion of macro '__force_inline'
__force_inline static void hw_xor_bits(io_rw_32 *addr, uint32_t mask) {
^~~~~~~~~~~~~~
/home/pi/pico-sdk/src/rp2_common/pico_platform/include/pico/platform.h:237:31: error: duplicate 'inline'
#define __force_inline inline __always_inline
^
/home/pi/pico-sdk/src/rp2_common/hardware_base/include/hardware/address_mapped.h:157:1: note: in expansion of macro '__force_inline'
__force_inline static void hw_write_masked(io_rw_32 *addr, uint32_t values, uint32_t write_mask) {
^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/my_project.dir/build.make:63: CMakeFiles/my_project.dir/main.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:1592: CMakeFiles/my_project.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
hel
November 16, 2021, 4:39pm
27
I’m getting the same thing on Twister OS - possibly some mismatch between compiler/c/pico-sdk versions going on?
It might be related to recent pico-sdk changes - this sounds like your error, if you wanted to keep an eye on it? Compiling Error: duplicate 'inline' · Issue #659 · raspberrypi/pico-sdk · GitHub
I’ll update the getting started to make it clearer that Raspberry Pi OS is the distro we recommend for dev purposes.
Thanks for trying, Man, I hope this gets fixed, Twister OS is so much better than the Vanilla Pi OS. It has way better window docking built in (like windows 10)
Brian