树莓派 PICO 的 cmake 文件编码问题
Issues with encoding for cmake files for raspberry PICO
我不确定到底发生了什么,我使用的是 cmake 3.21.1 并拥有适用于 visual studio 的最新 2019 构建工具,但这是 nmake 的输出:
AR10B2~1.EXE: error: CMakeFiles/Generated.dir/Generated.c.obj: No such file or directory
如您所见,cmake 文件存在某种编码问题。这是一个空的 hello world 项目。
C:\PICO\pico-project-generator\Generated\build>nmake
Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 1%] Creating directories for 'ELF2UF2Build'
[ 2%] No download step for 'ELF2UF2Build'
[ 3%] No update step for 'ELF2UF2Build'
[ 5%] No patch step for 'ELF2UF2Build'
[ 6%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is MSVC 19.29.30133.0
-- The CXX compiler identification is MSVC 19.29.30133.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/PICO/pico-project-generator/Generated/build/elf2uf2
[ 7%] Performing build step for 'ELF2UF2Build'
Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.obj
main.cpp
C:\PICO\pico-sdk\tools\elf2uf2\main.cpp(328): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\PICO\pico-sdk\tools\elf2uf2\main.cpp(334): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[100%] Linking CXX executable elf2uf2.exe
[100%] Built target elf2uf2
[ 8%] No install step for 'ELF2UF2Build'
[ 10%] Completed 'ELF2UF2Build'
[ 10%] Built target ELF2UF2Build
Scanning dependencies of target bs2_default
[ 11%] 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
[ 13%] Generating bs2_default.bin
[ 15%] Generating bs2_default_padded_checksummed.S
[ 15%] Built target bs2_default_padded_checksummed_asm
Scanning dependencies of target Generated
[ 16%] Building C object CMakeFiles/Generated.dir/Generated.c.obj
[ 17%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdlib/stdlib.c.obj
[ 18%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_gpio/gpio.c.obj
[ 20%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_claim/claim.c.obj
[ 21%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_platform/platform.c.obj
[ 22%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_sync/sync.c.obj
[ 23%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_uart/uart.c.obj
[ 25%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_divider/divider.S.obj
[ 26%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_time/time.c.obj
[ 27%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_time/timeout_helper.c.obj
[ 28%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_timer/timer.c.obj
[ 30%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/sem.c.obj
[ 31%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/lock_core.c.obj
[ 32%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/mutex.c.obj
[ 33%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/critical_section.c.obj
[ 35%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/datetime.c.obj
[ 36%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/pheap.c.obj
[ 37%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/queue.c.obj
[ 38%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_runtime/runtime.c.obj
[ 40%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_clocks/clocks.c.obj
[ 41%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_irq/irq.c.obj
[ 42%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_irq/irq_handler_chain.S.obj
[ 43%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_pll/pll.c.obj
[ 45%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_vreg/vreg.c.obj
[ 46%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_watchdog/watchdog.c.obj
[ 47%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_xosc/xosc.c.obj
[ 48%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_printf/printf.c.obj
[ 50%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_bit_ops/bit_ops_aeabi.S.obj
[ 51%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_bootrom/bootrom.c.obj
[ 52%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_divider/divider.S.obj
[ 53%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_aeabi.S.obj
[ 55%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_init_rom.c.obj
[ 56%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_math.c.obj
[ 57%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_v1_rom_shim.S.obj
[ 58%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_int64_ops/pico_int64_ops_aeabi.S.obj
[ 60%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_aeabi.S.obj
[ 61%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_init_rom.c.obj
[ 62%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_math.c.obj
[ 63%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_v1_rom_shim.S.obj
[ 65%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_malloc/pico_malloc.c.obj
[ 66%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_mem_ops/mem_ops_aeabi.S.obj
[ 67%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/crt0.S.obj
[ 68%] Building CXX object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp.obj
[ 70%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/binary_info.c.obj
[ 71%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio/stdio.c.obj
[ 72%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/reset_interface.c.obj
[ 73%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/stdio_usb.c.obj
[ 75%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/stdio_usb_descriptors.c.obj
[ 76%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c.obj
[ 77%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c.obj
[ 78%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/device/usbd.c.obj
[ 80%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/device/usbd_control.c.obj
[ 81%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/audio/audio_device.c.obj
[ 82%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/cdc/cdc_device.c.obj
[ 83%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/dfu/dfu_device.c.obj
[ 85%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/dfu/dfu_rt_device.c.obj
[ 86%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/hid/hid_device.c.obj
[ 87%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/midi/midi_device.c.obj
[ 88%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c.obj
[ 90%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/net/net_device.c.obj
[ 91%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/usbtmc/usbtmc_device.c.obj
[ 92%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/vendor/vendor_device.c.obj
[ 93%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/tusb.c.obj
[ 95%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/common/tusb_fifo.c.obj
[ 96%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c.obj
[ 97%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_unique_id/unique_id.c.obj
[ 98%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_flash/flash.c.obj
[100%] Linking CXX executable Generated.elf
AR10B2~1.EXE: error: CMakeFiles/Generated.dir/Generated.c.obj: No such file or directory
NMAKE : fatal error U1077: 'C:\PROGRA~2\GNUARM~12021~1.07\bin\AR10B2~1.EXE' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio19\BuildTools\VC\Tools\MSVC.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio19\BuildTools\VC\Tools\MSVC.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
我遇到了同样的问题,在这里找到了答案
卸载 CMAKE cmake-3.21.2 并安装 cmake-3.20.5
我的解决方案是安装 MinGW 工具链作为生成器。它还解决了 ELF2UF2 在任何完全清理的情况下的构建问题,并绕过了使用任何 Visual Studio 2019 构建工具的需要。我在虚拟机中测试了这个,这里安装了干净的 windows:https://youtu.be/BAoTBg8MJJ4
我不确定到底发生了什么,我使用的是 cmake 3.21.1 并拥有适用于 visual studio 的最新 2019 构建工具,但这是 nmake 的输出:
AR10B2~1.EXE: error: CMakeFiles/Generated.dir/Generated.c.obj: No such file or directory
如您所见,cmake 文件存在某种编码问题。这是一个空的 hello world 项目。
C:\PICO\pico-project-generator\Generated\build>nmake
Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 1%] Creating directories for 'ELF2UF2Build'
[ 2%] No download step for 'ELF2UF2Build'
[ 3%] No update step for 'ELF2UF2Build'
[ 5%] No patch step for 'ELF2UF2Build'
[ 6%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is MSVC 19.29.30133.0
-- The CXX compiler identification is MSVC 19.29.30133.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/PICO/pico-project-generator/Generated/build/elf2uf2
[ 7%] Performing build step for 'ELF2UF2Build'
Microsoft (R) Program Maintenance Utility Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.
[ 50%] Building CXX object CMakeFiles/elf2uf2.dir/main.cpp.obj
main.cpp
C:\PICO\pico-sdk\tools\elf2uf2\main.cpp(328): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\PICO\pico-sdk\tools\elf2uf2\main.cpp(334): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[100%] Linking CXX executable elf2uf2.exe
[100%] Built target elf2uf2
[ 8%] No install step for 'ELF2UF2Build'
[ 10%] Completed 'ELF2UF2Build'
[ 10%] Built target ELF2UF2Build
Scanning dependencies of target bs2_default
[ 11%] 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
[ 13%] Generating bs2_default.bin
[ 15%] Generating bs2_default_padded_checksummed.S
[ 15%] Built target bs2_default_padded_checksummed_asm
Scanning dependencies of target Generated
[ 16%] Building C object CMakeFiles/Generated.dir/Generated.c.obj
[ 17%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdlib/stdlib.c.obj
[ 18%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_gpio/gpio.c.obj
[ 20%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_claim/claim.c.obj
[ 21%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_platform/platform.c.obj
[ 22%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_sync/sync.c.obj
[ 23%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_uart/uart.c.obj
[ 25%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_divider/divider.S.obj
[ 26%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_time/time.c.obj
[ 27%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_time/timeout_helper.c.obj
[ 28%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_timer/timer.c.obj
[ 30%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/sem.c.obj
[ 31%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/lock_core.c.obj
[ 32%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/mutex.c.obj
[ 33%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_sync/critical_section.c.obj
[ 35%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/datetime.c.obj
[ 36%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/pheap.c.obj
[ 37%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/common/pico_util/queue.c.obj
[ 38%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_runtime/runtime.c.obj
[ 40%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_clocks/clocks.c.obj
[ 41%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_irq/irq.c.obj
[ 42%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_irq/irq_handler_chain.S.obj
[ 43%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_pll/pll.c.obj
[ 45%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_vreg/vreg.c.obj
[ 46%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_watchdog/watchdog.c.obj
[ 47%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_xosc/xosc.c.obj
[ 48%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_printf/printf.c.obj
[ 50%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_bit_ops/bit_ops_aeabi.S.obj
[ 51%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_bootrom/bootrom.c.obj
[ 52%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_divider/divider.S.obj
[ 53%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_aeabi.S.obj
[ 55%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_init_rom.c.obj
[ 56%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_math.c.obj
[ 57%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_double/double_v1_rom_shim.S.obj
[ 58%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_int64_ops/pico_int64_ops_aeabi.S.obj
[ 60%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_aeabi.S.obj
[ 61%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_init_rom.c.obj
[ 62%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_math.c.obj
[ 63%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_float/float_v1_rom_shim.S.obj
[ 65%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_malloc/pico_malloc.c.obj
[ 66%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_mem_ops/mem_ops_aeabi.S.obj
[ 67%] Building ASM object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/crt0.S.obj
[ 68%] Building CXX object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp.obj
[ 70%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_standard_link/binary_info.c.obj
[ 71%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio/stdio.c.obj
[ 72%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/reset_interface.c.obj
[ 73%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/stdio_usb.c.obj
[ 75%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_stdio_usb/stdio_usb_descriptors.c.obj
[ 76%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040/dcd_rp2040.c.obj
[ 77%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c.obj
[ 78%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/device/usbd.c.obj
[ 80%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/device/usbd_control.c.obj
[ 81%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/audio/audio_device.c.obj
[ 82%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/cdc/cdc_device.c.obj
[ 83%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/dfu/dfu_device.c.obj
[ 85%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/dfu/dfu_rt_device.c.obj
[ 86%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/hid/hid_device.c.obj
[ 87%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/midi/midi_device.c.obj
[ 88%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/msc/msc_device.c.obj
[ 90%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/net/net_device.c.obj
[ 91%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/usbtmc/usbtmc_device.c.obj
[ 92%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/class/vendor/vendor_device.c.obj
[ 93%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/tusb.c.obj
[ 95%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/lib/tinyusb/src/common/tusb_fifo.c.obj
[ 96%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/rp2040_usb_device_enumeration.c.obj
[ 97%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/pico_unique_id/unique_id.c.obj
[ 98%] Building C object CMakeFiles/Generated.dir/C_/PICO/pico-sdk/src/rp2_common/hardware_flash/flash.c.obj
[100%] Linking CXX executable Generated.elf
AR10B2~1.EXE: error: CMakeFiles/Generated.dir/Generated.c.obj: No such file or directory
NMAKE : fatal error U1077: 'C:\PROGRA~2\GNUARM~12021~1.07\bin\AR10B2~1.EXE' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio19\BuildTools\VC\Tools\MSVC.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio19\BuildTools\VC\Tools\MSVC.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
我遇到了同样的问题,在这里找到了答案
卸载 CMAKE cmake-3.21.2 并安装 cmake-3.20.5
我的解决方案是安装 MinGW 工具链作为生成器。它还解决了 ELF2UF2 在任何完全清理的情况下的构建问题,并绕过了使用任何 Visual Studio 2019 构建工具的需要。我在虚拟机中测试了这个,这里安装了干净的 windows:https://youtu.be/BAoTBg8MJJ4