Missing include file causes compile failure with "I don't know whats wrong" type of message

I attempted a "verify" on a sketch; and I had not installed a needed library. Thus, the include file that I referenced in the first line of the sketch did not exist. The Verify immediately exited with a message indicating that it didn't know what was wrong. A better message would have been "Missing include file at line xxx".

Error code message was:
Compilation error: Error: 2 UNKNOWN: exit status 1


If you enable verbose output during compile, it will tell you

Using board 'promicro' from platform in folder: C:\Users\sterretje\AppData\Local\Arduino15\packages\SparkFun\hardware\avr\1.1.12
Using core 'arduino' from platform in folder: C:\Users\sterretje\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3
Detecting libraries used...
"C:\\Users\\sterretje\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega32u4 -DF_CPU=8000000L -DARDUINO=10607 -DARDUINO_AVR_PROMICRO -DARDUINO_ARCH_AVR -DUSB_VID=0x1b4f -DUSB_PID=0x9204 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"SparkFun Pro Micro\"" "-IC:\\Users\\sterretje\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\sterretje\\AppData\\Local\\Arduino15\\packages\\SparkFun\\hardware\\avr\\1.1.12\\variants\\promicro" "C:\\Users\\sterretje\\AppData\\Local\\Temp\\arduino-sketch-CE22C7A4E842C457B61D122D4E5BACD3\\sketch\\random_techniques.ino.cpp" -o nul
Alternatives for sterretje.h: []
  -> candidates: []
Compilation error: Error: 2 UNKNOWN: exit status 1

Note that this was done with beta 7.

1 Like

Thank you

Hi @oktype3tim. Thanks for your valuable feedback. I agree 1000% with your suggestions. The lack of the standard "No such file or directory" error message in this situation was found to be caused by a bug in the Arduino CLI tool the IDE uses under the hood to handle the sketch compilation process. That bug has now been fixed:

That fix is not yet in Arduino IDE 2.x, but it will be in one of the upcoming releases.

The mysterious "Error: 2 UNKNOWN" part of the error message has since been changed to "Error: 13 INTERNAL", which, if anything, is even worse! But there is a proposal now for improving on that situation here:

1 Like

Thank you for the progress.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.