本帖最后由 kamp 于 2021-8-17 16:21 编辑
一、简要说明
1, 直接从win7 跳到了win11,发现Arduino IDE编译时出错“open NUL: The system cannot find the file specified.”(和程序无关,任何一个例子都是如此)
2,VsCode不受影响,但不是每次都愿意去移植,有时候就只想在Arduino IDE下编译。
3,试了4个版本的IDE,1.85;1.8.13;2.0beta5;2.0beta10 均是win7正常编译,win11出现1所说明的错误
4,仅编译,不涉及上传板子,也没有接任何板子。
5,从log分析,Arduino IDE编译总会在windows tmp文件夹中创建两个目录 arduino_build_512157 ;arduino_cache_797276 (后面的数字每次编译不同)。
6,都用最简单的blink例程编译,图一是win7 tmp目录下build目录产生的文件,图二是win11 build目录下产生的文件;而cache目录,win7 里面还会有一个core的文件夹,win11 cache目录下是空的
图一
图二
二,出错详细
开发板:"Arduino Nano, ATmega328P"
D:\arduino-1.8.5\arduino-builder -dump-prefs -logger=machine -hardware D:\arduino-1.8.5\hardware -tools D:\arduino-1.8.5\tools-builder -tools D:\arduino-1.8.5\hardware\tools\avr -built-in-libraries D:\arduino-1.8.5\libraries -libraries C:\Users\root\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10813 -build-path c:\Tmp\arduino_build_521045 -warnings=more -build-cache c:\Tmp\arduino_cache_271799 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\arduino-1.8.5\hardware\tools\avr -verbose D:\arduinoIDE\examples\01.Basics\Blink\Blink.ino
D:\arduino-1.8.5\arduino-builder -compile -logger=machine -hardware D:\arduino-1.8.5\hardware -tools D:\arduino-1.8.5\tools-builder -tools D:\arduino-1.8.5\hardware\tools\avr -built-in-libraries D:\arduino-1.8.5\libraries -libraries C:\Users\root\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10813 -build-path c:\Tmp\arduino_build_521045 -warnings=more -build-cache c:\Tmp\arduino_cache_271799 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.avrdude.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=D:\arduino-1.8.5\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=D:\arduino-1.8.5\hardware\tools\avr -verbose D:\arduinoIDE\examples\01.Basics\Blink\Blink.ino
Using board 'nano' from platform in folder: D:\arduino-1.8.5\hardware\arduino\avr
Using core 'arduino' from platform in folder: D:\arduino-1.8.5\hardware\arduino\avr
Detecting libraries used...
"D:\\arduino-1.8.5\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-ID:\\arduino-1.8.5\\hardware\\arduino\\avr\\cores\\arduino" "-ID:\\arduino-1.8.5\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "c:\\Tmp\\arduino_build_521045\\sketch\\Blink.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
open NUL: The system cannot find the file specified.
为开发板 Arduino Nano 编译时出错。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
倒数第三句 "c:\\Tmp\\arduino_build_521045\\sketch\\Blink.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
这个 -o nul 是什么意思,倒数第二句就是打不开这个nul
三、请各位大侠多指点解决思路,谢谢了!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
搞定了,全网带了解决办法的两个帖子,根据自己系统情况用
https://blog.csdn.net/weixin_42948341/article/details/108386813 https://github.com/itchio/itch/issues/1331#issuecomment-315744598
|