Pimoroni-pico (latest) build errors

Can someone of Pimoroni look at the issue I created at this link: Pimoroni-pico (latest) build errors. · Issue #571 · pimoroni/pimoroni-pico · GitHub

Can you build the pico-sdk examples successfully?

I’m by no means a cmake ninja, but did you clone your repos using the --recursive flag? I wonder if you’re missing some submodules?

git clone -b master https://github.com/raspberrypi/pico-sdk.git --recursive


git clone -b main https://github.com/pimoroni/pimoroni-pico.git --recursive

p.s. wsl tutorial here if you haven’t found it already: Pico C/C++ Development Using Windows

Hi hel, thank you for your reply. I don’t remember if I clone using the --recursive flag. I usually do. So I am going to make a new clone with --recursive and see what’s going to happen.

OK, I did the following. Unfortunately resulting in the same list of errors.
I am using the pico-sdk for quite a while and I did a git ‘pull’ to update that repo.

Below the commands and the results I just did:
2022-11-10 16h34 utc

/mnt/i/pico/ git clone -b main https://github.com/pimoroni/pimoroni-pico.git --recursive
cd pimoroni-pico
git submodule update --init
mkdir build
cd build
cmake …
Using PICO_SDK_PATH from environment (‘/mnt/i/pico/pico-sdk’)
PICO_SDK_PATH is /mnt/i/pico/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
Defaulting PICO platform compiler to pico_arm_gcc since not specified.
– Defaulting build type to ‘Release’ since not specified.
PICO compiler is pico_arm_gcc
– The C compiler identification is GNU 9.2.1
– The CXX compiler identification is GNU 9.2.1
– The ASM compiler identification is GNU
– Found assembler: /usr/bin/arm-none-eabi-gcc
Build type is Release
Defaulting PICO target board to pico since not specified.
Using board configuration from /mnt/i/pico/pico-sdk/src/boards/include/boards/pico.h
– Found Python3: /usr/bin/python3.8 (found version “3.8.10”) found components: Interpreter
TinyUSB available at /mnt/i/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
cyw43-driver available at /mnt/i/pico/pico-sdk/lib/cyw43-driver
lwIP available at /mnt/i/pico/pico-sdk/lib/lwip
– Configuring done <<<======== THIS STEP TOOK ABOUT 10 MINUTES
– Generating done
– Build files have been written to: /mnt/i/pico/pimoroni-pico/build

/mnt/i/pico/pimoroni-pico/build/ make
Scanning dependencies of target bs2_default
[ 0%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.obj
[ 0%] Linking ASM executable bs2_default.elf
[ 0%] Built target bs2_default
Scanning dependencies of target PioasmBuild
[ 0%] Creating directories for ‘PioasmBuild’
[ 0%] No download step for ‘PioasmBuild’
[ 0%] No patch step for ‘PioasmBuild’
[ 0%] No update step for ‘PioasmBuild’
[ 0%] Performing configure step for ‘PioasmBuild’
loading initial cache file /mnt/i/pico/pimoroni-pico/build/pico-sdk/src/rp2_common/cyw43_driver/pioasm/tmp/PioasmBuild-cache-Release.cmake
– The CXX compiler identification is GNU 9.4.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: /mnt/i/pico/pimoroni-pico/build/pioasm
[ 0%] Performing build step for ‘PioasmBuild’
Scanning dependencies of target pioasm
[ 10%] Building CXX object CMakeFiles/pioasm.dir/main.cpp.o
In file included from /usr/include/newlib/c++/9.2.1/tr1/cstdarg:33,
from /usr/include/newlib/c++/9.2.1/tr1/stdarg.h:33,
from /usr/include/wchar.h:43,
from /usr/include/c++/9/cwchar:44,
from /usr/include/c++/9/bits/postypes.h:40,
from /usr/include/c++/9/iosfwd:40,
from /usr/include/c++/9/ios:38,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from /mnt/i/pico/pico-sdk/tools/pioasm/main.cpp:7:
/usr/include/newlib/c++/9.2.1/cstdarg:62:11: error: ‘::va_list’ has not been declared
62 | using ::va_list;
| ^~~~~~~
In file included from /usr/include/c++/9/cwchar:44,
from /usr/include/c++/9/bits/postypes.h:40,
from /usr/include/c++/9/iosfwd:40,
from /usr/include/c++/9/ios:38,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from /mnt/i/pico/pico-sdk/tools/pioasm/main.cpp:7:
/usr/include/wchar.h:105:38: error: ‘size_t’ has not been declared
105 | const wchar_t *__restrict __src, size_t __n)
| ^~~~

[…and followed many more errors as reported b4 in the issue I created on Github…]

You know what: It’s a problem inside WSL2 and the installed libraires. I googled for several errors that were reported. While trying to debug those errors I encountered stupid errors in a …h file
that #include … other definition files but used the format #include <file.h> while file.h was in the same folder. So it hat to be written as "#include “file.h”. And more of those things.
However I stepped from one error into the other. I got tired of it and quit.
Then I started my desktop PC in ‘real’ Ubuntu-Linux mode since I have one drive setup for that.
Then, in a terminal session, I cd’ed to /pico/pimoroni-pico/build. I cleaned the folder with ‘rm -rf*’.
Issued ‘cmake …’ and then the ‘make’ command which just finished without any error.

Conclusion: MS Windows 11 WSL2 is a mess to build stuff like this.
Example: the step: – Configuring, during the ‘cmake …’ execution,
took 10 minutes. In the ‘real’ Ubuntu-Linux session this step took a second or two! Unbelievable.
And I have the latest hardware.
Sorry to have bothered you with this. I am going to close the issue in Github too.
Thanks for your reply!

Glad to hear you’re sorted!