无法使用 Eclipse 在 Windows PC 上编译 Raspberry Pico 软件



我曾尝试在Windows 10 PC上安装Eclipse,以使用本教程为Raspberry Pico编译软件:https://mcuoneclipse.com/2022/07/16/getting-started-raspberry-pi-pico-rp2040-with-eclipse-and-j-link/

安装所有不同的软件都很顺利,但当我试图编译"眨眼"的例子时,我遇到了很多错误:

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)

一件事是,我的电脑上至少有7个不同的make.exe文件和5个不同的gcc.exe文件,其中许多都在windows路径中。很明显,这里选错了,但我不知道如何解决这个问题。(在Eclpise中,我可以在项目设置中选择一个自定义make.exe,但即使这样,也会选择另一个。(

找到问题的原因。Eclipse不使用windows路径straigth,而是制作一个可以编辑的路径副本,该路径位于Properties下的每个项目->C/C++内部版本->环境->路径您可以删除不相关文件夹的所有路径条目。这是一个不错的解决方案。一旦你知道了。问题解决了。

最新更新