环境
系统:windows8.1
ARM-GCC-compile
cmake
pico-sdk:https://github.com/raspberrypi/pico-sdk
pico-project-generator:https://github.com/raspberrypi/pico-project-generator
make工具:官网给的是visual studio 2019的nmake,但是报错了,我改成了MinGW32-make
报错情况
前期按照mobyw的库https://github.com/mobyw/pico-getting-started进行安装即可,步骤是:
- 1、ARM-GCC compile
- 2、pico-sdk
- 2、cmake
- 3、minGW
- 4、pico-project-generator
使用pi_project.py建立新的project,使用“NMake Makefilfs”时,nmake命令报错如下:
(general) λ cmake ..
PICO_SDK_PATH is E:/pico/sdk/pico-sdk
PICO platform is rp2040.
Using regular optimized debug build (set PICO_DEOPTIMIZED_DEBUG=1 to de-optimize)
PICO target board is pico.
Using board configuration from E:/pico/sdk/pico-sdk/src/boards/include/boards/pico.h
TinyUSB available at E:/pico/sdk/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; enabling build support for USB.
Compiling TinyUSB with CFG_TUSB_DEBUG=1
-- Configuring done
-- Generating done
-- Build files have been written to: E:/pico/sdk/pico-project-generator/ProjectwithNmake/build
E:\pico\sdk\pico-project-generator\ProjectwithNmake\build (master -> origin)
(general) λ nmake
Microsoft (R) 程序维护实用工具 14.29.30141.0 版
版权所有 (C) Microsoft Corporation。 保留所有权利。
[ 1%] Creating directories for 'ELF2UF2Build'
[ 3%] No download step for 'ELF2UF2Build'
[ 5%] No update step for 'ELF2UF2Build'
[ 6%] No patch step for 'ELF2UF2Build'
[ 8%] Performing configure step for 'ELF2UF2Build'
-- The C compiler identification is MSVC 19.29.30141.0
-- The CXX compiler identification is MSVC 19.29.30141.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- 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
-- 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 - broken
CMake Error at E:/Cmake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx86/x86/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: E:/pico/sdk/pico-project-generator/ProjectwithNmake/build/elf2uf2/CMakeFiles/CMakeTmp
Run Build Command(s):nmake -f Makefile /nologo cmTC_b3b91\fast && "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe" -f CMakeFiles\cmTC_b3b91.dir\build.make /nologo -L
CMakeFiles\cmTC_b3b91.dir\build
Building C object CMakeFiles/cmTC_b3b91.dir/testCCompiler.c.obj
E:\Cmake\bin\cmake.exe -E cmake_cl_compile_depends --dep-file=CMakeFiles\cmTC_b3b91.dir\testCCompiler.c.obj.d --working-dir=E:\pico\sdk\pico-project-generator\ProjectwithNmake\build\elf2uf2\CMakeFiles\CMakeTmp --filter-prefix="注意:
包含文件: " -- C:\PROGRA~2\MICROS~4\2019\BUILDT~1\VC\Tools\MSVC\1429~1.301\bin\Hostx86\x86\cl.exe @C:\Users\asus-pc\Ap
pData\Local\Temp\nm5394.tmp
testCCompiler.c
Linking C executable cmTC_b3b91.exe
E:\Cmake\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_b3b91.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~2\MICROS~4\2019\BUILDT~1\VC\Tools\MSVC\1429~1.301\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\cmTC_b3b91.dir\objects1.rsp @C:\Users\asus-pc\AppData\Local\Temp\nm547F.tmp
RC Pass 1: command "rc /fo CMakeFiles\cmTC_b3b91.dir/manifest.res CMakeFiles\cmTC_b3b91.dir/manifest.rc" failed (exit code 0) with the following output:
系统找不到指定的文件。NMAKE : fatal error U1077: “E:\Cmake\bin\cmake.exe”: 返回代码“0xffffffff”
Stop.
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe"”: 返回代码“0x2”
Stop.
CMake will not be able to correctly generate this project.
Call Stack (most rece

在Windows 8.1系统上配置Raspberry Pi Pico的C++开发环境时,遇到使用nmake报错的问题。尝试使用MingW32-make代替nmake,但初始环境仍存在错误。解决方法包括:1) 安装MingW的全部包,确保包含MinGW32-make;2) 删除cmakecache文件后,重新指定使用MinGW32 Makefiles。经过这些步骤,成功构建并生成了 uf2 文件。

3963

被折叠的 条评论
为什么被折叠?



