NMake: UTF-8 BOM breaks Raspberry PI Pico build on Windows
I'm using VS Code to build a C++ project for the Raspberry PI Pico. Set everything up like described in the RP documentation. When using CMake with a version newer than 3.20.6 I get the following error during the build:
[build] [ 13%] Linking CXX executable pico_cnc.elf
[build] AR10B2~1.EXE: error: CMakeFiles/pico_cnc.dir/program.cpp.obj: No such file or directory
[build] NMAKE : fatal error U1077: 'C:\PROGRA~2\GNUARM~1\102020~1\bin\AR10B2~1.EXE' : return code '0x1'
[build] Stop.
The garbled output on the second line just before CMakeFiles
is the BOM of the file containing a list of object files to link (objects1.rsp
). If I remove the BOM, it works OK.
I guess this has to do with the fix of #21792 (closed).
Edited by Brad King