我正在尝试设置环境为新的 PICO 开发一些程序,但在出现此错误后只编译一次:
[main] Building folder: pico-examples
[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/pico/pico-examples/build --config Debug --target blink --
[build] Scanning dependencies of target bs2_default
[build] [ 0%] Built target bs2_default
[build] [ 0%] Built target bs2_default_padded_checksummed_asm
[build] [ 0%] Performing build step for 'ELF2UF2Build'
[build]
[build] Microsoft (R) Program Maintenance Utility Version 14.28.29337.0
[build] Copyright (C) Microsoft Corporation. All rights reserved.
[build]
[build] [100%] Built target elf2uf2
[build] [ 0%] No install step for 'ELF2UF2Build'
[build] [ 0%] Completed 'ELF2UF2Build'
[build] [ 0%] Built target ELF2UF2Build
[build] Scanning dependencies of target blink
[build] Consolidate compiler generated dependencies of target blink
[build] blink\CMakeFiles\blink.dir\compiler_depend.make(4) : fatal error U1033: syntax error : ':' unexpected
[build] Stop.
[build] NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\Nmake.exe"' : return code '0x2'
[build] Stop.
[build] NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\Nmake.exe"' : return code '0x2'
[build] Stop.
[build] NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\Nmake.exe"' : return code '0x2'
[build] Stop.
[build] Build finished with exit code 2
我正在从 Raspberry SDK 编译它的标准示例的闪烁应用程序:
#include "pico/stdlib.h"
int main() {
const uint LED_PIN = 25;
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
while (true) {
gpio_put(LED_PIN, 1);
sleep_ms(250);
gpio_put(LED_PIN, 0);
sleep_ms(250);
}
}
我已经安装了 VS 代码,并且在为此 PICO 安装了 VS 2019 之后。我一步一步地按照 Raspberry 的文档(开始使用 Raspberry PICO)进行操作。也由 VS2019 的命令提示符启动。
我曾尝试单独安装最后一个 Windows SDK,我也重新安装了 Visual Studio。但还是一样。
有人可以在这个话题上帮助我吗?这个问题我睡不着:(
自动生成的文件是什么问题示例:
# CMAKE generated file: DO NOT EDIT!
# Generated by "NMake Makefiles" Generator, CMake Version 3.20
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C:\pico\pico-sdk\src\common\pico_sync\critical_section.c
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-sdk\src\common\pico_sync\critical_section.c
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-sdk\src\common\pico_sync\include\pico\critical_section.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-sdk\src\common\pico_sync\include\pico\lock_core.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico\types.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\lib\gcc\arm-none-eabi\10.2.1\include\stdint.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\stdint.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\machine\_default_types.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\features.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\_newlib_version.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\_intsup.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\_stdint.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\lib\gcc\arm-none-eabi\10.2.1\include\stdbool.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: c\:\progra~2\gnuarm~1\102020~1\lib\gcc\arm-none-eabi\10.2.1\include\stddef.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-examples\build\generated\pico_base\pico\version.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico\config.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-examples\build\generated\pico_base\pico\config_autogen.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync\critical_section.c.obj: C\:\pico\pico-sdk\src\boards\include\boards\pico.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\common\pico_sync
...
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico\types.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: c\:\progra~2\gnuarm~1\102020~1\lib\gcc\arm-none-eabi\10.2.1\include\stdint.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\stdint.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\_intsup.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\_stdint.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: c\:\progra~2\gnuarm~1\102020~1\lib\gcc\arm-none-eabi\10.2.1\include\stdbool.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: C\:\pico\pico-examples\build\generated\pico_base\pico\version.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico\config.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: C\:\pico\pico-examples\build\generated\pico_base\pico\config_autogen.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: C\:\pico\pico-sdk\src\boards\include\boards\pico.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float\float_init_rom.c.obj: C\:\pico\pico-sdk\src\rp2_common\pico_platform\include\pico\platform.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_float.
...
.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\machine\_default_types.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\features.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\_newlib_version.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\_intsup.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\_stdint.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\stdio.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\_ansi.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\newlib.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\config.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\machine\ieeefp.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\cdefs.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\lib\gcc\arm-none-eabi\10.2.1\include\stddef.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\lib\gcc\arm-none-eabi\10.2.1\include\stdarg.h
blink\CMakeFiles\blink.dir\C_\pico\pico-sdk\src\rp2_common\pico_printf\printf.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\reent.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\rp2_common\pico_platform\include\pico\platform.h
blink\CMakeFiles\blink.dir\blink.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\cdefs.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico\types.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\rp2040\hardware_regs\include\hardware\platform_defs.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\rp2040\hardware_regs\include\hardware\regs\addressmap.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico\assert.h
blink\CMakeFiles\blink.dir\blink.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\assert.h
blink\CMakeFiles\blink.dir\blink.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\_ansi.h
blink\CMakeFiles\blink.dir\blink.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\newlib.h
blink\CMakeFiles\blink.dir\blink.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\sys\config.h
blink\CMakeFiles\blink.dir\blink.c.obj: c\:\progra~2\gnuarm~1\102020~1\arm-none-eabi\include\machine\ieeefp.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\common\pico_base\include\pico\error.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\rp2_common\pico_stdio\include\pico\stdio.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\common\pico_time\include\pico\time.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\rp2_common\hardware_timer\include\hardware\timer.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\rp2040\hardware_structs\include\hardware\structs\timer.h
blink\CMakeFiles\blink.dir\blink.c.obj: C\:\pico\pico-sdk\src\rp2_common\ha
C:\pico\pico-sdk\src\rp2_common\hardware_vreg\vreg.c:
C\:\pico\pico-sdk\src\rp2_common\hardware_vreg\vreg.c:
C\:\pico\pico-sdk\src\rp2_common\hardware_vreg\include\hardware\vreg.h:
C\:\pico\pico-sdk\src\rp2040\hardware_structs\include\hardware\structs\vreg_and_chip_reset.h:
C\:\pico\pico-sdk\src\rp2040\hardware_regs\include\hardware\regs\vreg_and_chip_reset.h:
C:\pico\pico-sdk\src\rp2_common\hardware_watchdog\watchdog.c:
C\:\pico\pico-sdk\src\rp2_common\hardware_watchdog\watchdog.c:
C\:\pico\pico-sdk\src\rp2040\hardware_structs\include\hardware\structs\watchdog.h:
C\:\pico\pico-sdk\src\rp2040\hardware_regs\include\hardware\regs\watchdog.h:
C\:\pico\pico-sdk\src\rp2040\hardware_structs\include\hardware\structs\psm.h:
C\:\pico\pico-sdk\src\rp2040\hardware_regs\include\hardware\regs\psm.h:
C\:\pico\pico-sdk\src\rp2_common\hardware_xosc\xosc.c:
C\:\pico\pico-sdk\src\rp2_common\pico_stdio_uart\stdio_uart.c:
C\:\pico\pico-sdk\src\rp2_common\pico_bootrom\bootrom.c:
C\:\pico\pico-sdk\src\rp2_common\pico_bootrom\include\pico\bootrom.h:
C\:\pico\pico-sdk\src\rp2_common\pico_double\double_init_rom.c:
提前致谢。此致