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

Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"

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

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

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

hello I have the same problem, you found a solution??

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.

Atmel Studio > Project > Properties > Packs

Note the Current Version.

If the Pack version is not critical to the application: > click Change version > select Use the latest version (or
select another version which is already installed).

If the Pack version is critical, download and install the Pack indicated by Current Version: Tools > Device Pack Manager.

Atmega328p should not need any pack installation...

1 Like

And the Arduino IDE should not need pack installations either, ever, but OP is reporting this issue with the IDE!

We have a few other reports of this issue.... as far as I can tell nobody has solved it yet though.

Can you do the following:

File -> Preferences. Under "show verbose output", check "Compiling". Attempt the compile again and post the output here.

I just downloaded 1.8.8, and have the same problem. Here's the output with verbose compilation

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/flounder/Library/Arduino15/packages -hardware /Users/flounder/Documents/Arduino/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/flounder/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/flounder/Documents/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10808 -build-path /var/folders/g2/chzccymj1ll4vnn2pg5v4gfr0000gn/T/arduino_build_854211 -warnings=more -build-cache /var/folders/g2/chzccymj1ll4vnn2pg5v4gfr0000gn/T/arduino_cache_549766 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Users/flounder/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=/Users/flounder/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=/Users/flounder/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=/Users/flounder/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.avr-gcc.path=/Users/flounder/Library/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=/Users/flounder/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -verbose /Users/flounder/Documents/Arduino/testblink/testblink.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/flounder/Library/Arduino15/packages -hardware /Users/flounder/Documents/Arduino/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/flounder/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/flounder/Documents/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10808 -build-path /var/folders/g2/chzccymj1ll4vnn2pg5v4gfr0000gn/T/arduino_build_854211 -warnings=more -build-cache /var/folders/g2/chzccymj1ll4vnn2pg5v4gfr0000gn/T/arduino_cache_549766 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Users/flounder/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14 -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=/Users/flounder/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14 -prefs=runtime.tools.arduinoOTA.path=/Users/flounder/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.arduinoOTA-1.2.1.path=/Users/flounder/Library/Arduino15/packages/arduino/tools/arduinoOTA/1.2.1 -prefs=runtime.tools.avr-gcc.path=/Users/flounder/Library/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=/Users/flounder/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -verbose /Users/flounder/Documents/Arduino/testblink/testblink.ino
Using board 'uno' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
/Users/flounder/Library/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_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard /var/folders/g2/chzccymj1ll4vnn2pg5v4gfr0000gn/T/arduino_build_854211/sketch/testblink.ino.cpp -o /dev/null
fork/exec /Users/flounder/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-g++: no such file or directory
Error compiling for board Arduino/Genuino Uno.

flounder:
I just downloaded 1.8.8, and have the same problem. Here's the output with verbose compilation

fork/exec /Users/flounder/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-g++: no such file or directory

That's a different problem. Usually the solution is to delete the Arduino15 folder (/Users/flounder/Library/Arduino15 in your case). Note that will cause you to lose any boards you have installed via Boards Manager and your preferences settings. The former is not that big of a deal (other than taking some time and bandwidth) because you can simply reinstall them. The latter may be annoying, especially if you have very customized preferences. You can save the file /Users/flounder/Library/Arduino15/preferences.txt somewhere safe before deleting the Arduino15 folder and then replace the file after if you want to preserve your preferences. Other than that, there should not be anything precious in the Arduino15 folder. However, it's always a good idea to make a backup before deleting things, just to be safe.

Well, I went looking for users/flounder/Library/Arduino15 and it does not seem to exist. At least, as far as Finder is concerned. Apparently there is no way to actually insert an image, or I could show you the screenshot of what Finder is showing. But in ..../flounder I found Google Drive and Macbook Pro, and the last I looked, sorting alphabetically by name, Library should have been between these two.

When I downloaded 1.8.8, I found that there were a lot of board updates, so I loaded them into 1.8.8; similarly for the libraries. My assumption was that there should have been an Arduino18 directory, and I needed to reconfigure the IDE to refer to the (new) set of directories. But I couldn't find Library, or anything that suggested how to redirect to another directory, so I found myself stuck. The table below is a tedious reproduction; the elements in red are the ones highlighted in finder. Note that if I select Library (in the second column), it has no folders starting with "Arduino".


| |Macintosh HD | |Applications | |flounder | |Applications | | |
| - | - | - | - | - |
| |Network | |Damaged Files | |Guest | |Applicatio...(Parallels) | | |
| |Remote Disk | |Library | |Shared | |Downloads | | |
| | | |System | | | |Dropbox | | |
| | | |User Information | | | |eclipse | | |
| | | |Users | | | |Github | | |
| | | | | | | |Google Drive | | |
| | | | | | | |Macbook Pro | | |
| | | | | | | | : | | |


flounder:
Well, I went looking for users/flounder/Library/Arduino15 and it does not seem to exist. At least, as far as Finder is concerned.

It's there, but Finder is hiding it from you.

flounder:
My assumption was that there should have been an Arduino18 directory, and I needed to reconfigure the IDE to refer to the (new) set of directories.

No. There's no "Arduino18" directory. Modern IDE versions (1.5.x and newer) use the Arduino15 directory, older IDE versions use the Arduino directory.

So, advice on how to find the folder if Finder doesn’t find it?

In Windows, I could enable the viewing of hidden and system files; I have not discovered how to do this on macOS.

Try this:

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

1.Search --> Edit the system environment variables
2.In page System Properties (Advanced)
3.Open Enviroment Variables...
4.In System variables find GCC and delete. Finish

Good afternoon! I haven't started my experiments with Arduino yet, I have the same problem and the same error.Please help me. Detailed compilation in the attached file.Thanks!

Mistake.txt (4.33 KB)

Hi @svem-dir. Do this:

  • Start Windows Control Panel.
  • Navigate to System and Security > System > Advanced system settings.
  • Click the "Advanced" tab.
  • Click the "Environment variables..." button.
  • In the "System Variables" list, you should see "GCC EXEC PREFIX". Click on it.
  • Click the "Delete" button.
  • Click the "OK" button.

The error should now be fixed.

Thanks a lot. I checked.I don't have a" GCC EXEC PREFIX " entry.I attach the screen.The error remained.What else could it be? Thanks.

Mistake_after_control.txt (4.33 KB)