I've tried to setup Eclipse on a Windows 10 PC to compile software for the Raspberry Pico, using this tutorial: https://mcuoneclipse.com/2022/07/16/getting-started-raspberry-pi-pico-rp2040-with-eclipse-and-j-link/
Installing all the different pieces of software went well, but when I try to compile the 'blink' example, I get lots of errors:
15:19:01 **** Incremental Build of configuration Default for project pico blinky ****
"C:\\Programs\\GnuMake\\make" all
PICO_SDK_PATH is C:/Programs/Pico/pico-sdk
PICO platform is rp2040.
-- The C compiler identification is GNU 11.3.1
-- The CXX compiler identification is GNU 11.3.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Program Files (x86)/Arm GNU Toolchain arm-none-eabi/11.3 rel1/bin/arm-none-eabi-gcc.exe
-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
Build type is Debug
Using regular optimized debug build (set PICO_DEOPTIMIZED_DEBUG=1 to de-optimize)
PICO target board is pico.
Using board configuration from C:/Programs/Pico/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: C:/Program Files/Python310/python.exe (found version "3.10.6") found components: Interpreter
TinyUSB available at C:/Programs/Pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
Compiling TinyUSB with CFG_TUSB_DEBUG=1
cyw43-driver available at C:/Programs/Pico/pico-sdk/lib/cyw43-driver
lwIP available at C:/Programs/Pico/pico-sdk/lib/lwip
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Programs/Pico/pico-examples-eclipse
Scanning dependencies of target ELF2UF2Build
[ 0%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Programs/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/Programs/MinGW/bin/gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"C:/Programs/MinGW/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Programs/Pico/pico-examples-eclipse/elf2uf2/CMakeFiles/CMakeTmp
-- Configuring incomplete, errors occurred!
See also "C:/Programs/Pico/pico-examples-eclipse/elf2uf2/CMakeFiles/CMakeOutput.log".
Run Build Command(s):C:/PROGRA~2/EMBARC~1/Studio/16.0/bin/make.exe cmTC_62d89/fast && MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
See also "C:/Programs/Pico/pico-examples-eclipse/elf2uf2/CMakeFiles/CMakeError.log".
Error makefile 11: Colon expected
*** 1 errors during make ***
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
make[2]: *** [blink/CMakeFiles/ELF2UF2Build.dir/build.make:125: blink/elf2uf2/src/ELF2UF2Build-stamp/ELF2UF2Build-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:5121: blink/CMakeFiles/ELF2UF2Build.dir/all] Error 2
make: *** [makefile:91: all] Error 2
"C:/Programs/GnuMake/make all" terminated with exit code 2. Build might be incomplete.
15:19:30 Build Failed. 3 errors, 0 warnings. (took 28s.721ms)
One thing is that I have at least 7 different make.exe files and at least 5 different gcc.exe files on my pc, and many are in the windows path. It's obvious that the wrong ones are chosen here, but I'm clueless on how to fix this. (In Eclpise I can select a custom make.exe in the project settings, but even then another one is chosen.)
CodePudding user response:
Found the cause of the problem. Eclipse it not using the windows path straigth away, but makes a copy of the path which you can edit, which is located per project under Properties -> C/C Build -> Environment -> Path. You can remove all path entries to non-relevant folders. Quite a nice solution. Once you know about it. Problem solved.