[Solved] Editor can't detect libraries

I recently started working with an Arduino Nano, just as I try to compile the Blink example code it showcases a typical message I've seen while researching in the forums.

This is happening in the offline editor, if I jump to the web based one, it works flawlessly; problem is, I live in Venezuela and internet isn't very constant here, I can't rely on internet connection.

avr-g++: error: device-specs/specs-atmega328p: No such file or directory

After researching and trying to follow along solutions for other users, I ended doing the following:

  • Installing the most recent libraries through Board Manager
  • Deleting arduino15 files
  • Reinstalling the editor
  • Going for compatibility mode with Windows 7
  • Executing as administrator

I haven't disabled Windows Defender, don't know if it might be the cause of this. I'll attach the console output below. Thanks in advance!

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Evil Tomato\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Evil Tomato\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Evil Tomato\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10808 -build-path C:\Users\EVILTO~1\AppData\Local\Temp\arduino_build_692326 -warnings=none -build-cache C:\Users\EVILTO~1\AppData\Local\Temp\arduino_cache_724336 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -verbose C:\Users\EVILTO~1\AppData\Local\Temp\untitled1160830118.tmp\sketch_feb26a\sketch_feb26a.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Evil Tomato\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Evil Tomato\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Evil Tomato\Documents\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10808 -build-path C:\Users\EVILTO~1\AppData\Local\Temp\arduino_build_692326 -warnings=none -build-cache C:\Users\EVILTO~1\AppData\Local\Temp\arduino_cache_724336 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Users\Evil Tomato\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.2.1 -verbose C:\Users\EVILTO~1\AppData\Local\Temp\untitled1160830118.tmp\sketch_feb26a\sketch_feb26a.ino
Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\\Users\\Evil Tomato\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\5.4.0-atmel3.6.1-arduino2/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=10808 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\EVILTO~1\\AppData\\Local\\Temp\\arduino_build_692326\\sketch\\sketch_feb26a.ino.cpp" -o nul
Error while detecting libraries included by C:\Users\EVILTO~1\AppData\Local\Temp\arduino_build_692326\sketch\sketch_feb26a.ino.cpp
Generating function prototypes...
"C:\\Users\\Evil Tomato\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\5.4.0-atmel3.6.1-arduino2/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=10808 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\EVILTO~1\\AppData\\Local\\Temp\\arduino_build_692326\\sketch\\sketch_feb26a.ino.cpp" -o "C:\\Users\\EVILTO~1\\AppData\\Local\\Temp\\arduino_build_692326\\preproc\\ctags_target_for_gcc_minus_e.cpp"
avr-g++: error: device-specs/specs-atmega328p: No such file or directory

exit status 1
Error compiling for board Arduino Nano.

Running in compatibility mode is not required and nor is disabling windows defender.

You might want to search out some of "pert" posts as he covered most of the issues with the NANO.
Most simple cause is not selecting the correct flavour of NANO as the more recent IDE's will give you two flavours. 238 and 328 old bootloader.

Most CLONES use the old bootloader.

Problem is (Not sure about this one), not even verifying works for the code, is it required to be plugged to the Nano for the code to be verified?

In any case I'm still doing everything with the Nano plugged in.

No a sketch can be verified without a board.

Only UPLOAD needs a board.

I run windows 7 and 10 so know it works. from IDE 1.8.5 upwards
As suggested use the search option to find pert's posts.

Ok will do.

veryeviltomato:

  • Deleting arduino15 files

Are you certain that you deleted from the correct Arduino15 folder? The reason I ask is that I see from your output that the Arduino15 folder is still in use:

veryeviltomato:

"C:\\Users\\Evil Tomato\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\5.4.0-atmel3.6.1-arduino2/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=10808 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\EVILTO~1\\AppData\\Local\\Temp\\arduino_build_692326\\sketch\\sketch_feb26a.ino.cpp" -o "C:\\Users\\EVILTO~1\\AppData\\Local\\Temp\\arduino_build_692326\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Try deleting C:\Users\Evil Tomato\AppData\Local\Arduino15, restart the Arduino IDE, then attempt a compilation without first installing anything from Boards Manager (which will be installed to the Arduino15 folder and put you right back where you started).

pert:
Are you certain that you deleted from the correct Arduino15 folder? The reason I ask is that I see from your output that the Arduino15 folder is still in use:Try deleting C:\Users\Evil Tomato\AppData\Local\Arduino15, restart the Arduino IDE, then attempt a compilation without first installing anything from Boards Manager (which will be installed to the Arduino15 folder and put you right back where you started).

Yes, I'm sure I've deleted it multiple times, it probably shows because I reinstalled it again when I was getting the output.

This is my new output following your instructions, thanks in advance for the help!

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Evil Tomato\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10808 -build-path C:\Users\EVILTO~1\AppData\Local\Temp\arduino_build_812799 -warnings=none -build-cache C:\Users\EVILTO~1\AppData\Local\Temp\arduino_cache_569001 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\EVILTO~1\AppData\Local\Temp\untitled56942917.tmp\sketch_feb27a\sketch_feb27a.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Evil Tomato\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10808 -build-path C:\Users\EVILTO~1\AppData\Local\Temp\arduino_build_812799 -warnings=none -build-cache C:\Users\EVILTO~1\AppData\Local\Temp\arduino_cache_569001 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\EVILTO~1\AppData\Local\Temp\untitled56942917.tmp\sketch_feb27a\sketch_feb27a.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\\Program Files (x86)\\Arduino\\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=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\EVILTO~1\\AppData\\Local\\Temp\\arduino_build_812799\\sketch\\sketch_feb27a.ino.cpp" -o nul
Error while detecting libraries included by C:\Users\EVILTO~1\AppData\Local\Temp\arduino_build_812799\sketch\sketch_feb27a.ino.cpp
Generating function prototypes...
"C:\\Program Files (x86)\\Arduino\\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=10808 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\EVILTO~1\\AppData\\Local\\Temp\\arduino_build_812799\\sketch\\sketch_feb27a.ino.cpp" -o "C:\\Users\\EVILTO~1\\AppData\\Local\\Temp\\arduino_build_812799\\preproc\\ctags_target_for_gcc_minus_e.cpp"
avr-g++: error: device-specs/specs-atmega328p: No such file or directory

exit status 1
Error compiling for board Arduino/Genuino Uno.

This sort of error could be caused by your antivirus software. Try TEMPORARILY disabling your antivirus for a single compilation to see if the problem goes away, then turn the antivirus back on. If the problem doesn't occur with the antivirus off you will need to adjust the settings of your antivirus to whitelist the appropriate file, folder, or process so it doesn't interfere with compilation.

I don't have any antiviruses installed! I even got Windows Defender deactivated, I'm usually a very safe user when it comes to browsing.

OK, it was just a wild guess anyway. Another wild guess: from the output, it doesn't appear so, but does you user name happen to have any "strange" (sorry, I know that's not the correct term) characters in it? I did a test to see if a space in the user name would cause it, but it didn't cause any problems for me so I don't think that's it.

Mhmmm! It does have an space! It's Evil Tomato, I think it might be the reason

I created a user with a space in the name and still couldn't reproduce the problem.

pert:
I created a user with a space in the name and still couldn't reproduce the problem.

Sorry for taking so long to answer the different timezones makes it hard for me to keep track of the post. Really not sure at this point of what to do, will see if I can keep testing what could be the problem, I'll see if I can run a VM on Windows 7 during the course of the following week to see if it makes any difference.

I tried again but installing it through the Windows Store, I made sure it was allowed through the Firewall but it still shows the exact same error.

veryeviltomato contacted me to let me know they finally found the solution to this problem, but couldn't find this thread to update. In the hopes it might help others with this same problem, I'm posting the information here:

veryeviltomato:
It seems there was this GCC EXEC PREFIX environment variable on Windows that was changing the compiler for all of my GCC compiling applications, this messed up all the libraries IDE was trying to get, so I deleted it and I was able to compile using any application that used a GCC compiler no problem (Arduin IDE, Dev C++, Codeblocks, etc).