Error message in IDE avr-g++: error: device-specs/specs-atmega328p: No such file

Hello guys, do you all have issue on this error message from IDE?

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

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

Since, I already try to deactivate the antivirus and remove the antivirus, download the new vision of IDE also get the same problem.

i have try many of times to solve this problem already but it failed to verified and upload to arduino board

i using the windows 10 home 64 bit

Please assist me thank you. i have a integrated design project which relate to this arduino programmer

This error indicates you need to take some drastic action. Be aware this is somewhat advanced and will remove any boards you have installed via Boards Manager:

  • In the Arduino IDE, click the link on the line following File > Preferences > More preferences can be edited directly in the file. This will open the Arduino15 (or similar name depending on OS) folder.
  • Delete all files and folders under the Arduino15 folder except for preferences.txt. Please be very careful when deleting things from your computer. When in doubt, back up!
  • Restart the Arduino IDE

Verify that you can now use your board before reinstalling any packages via Boards Manager.

Hi pert, i follow the steps that you have given to me but the Arduino IDE still occur the error same as that i posted even i have connect the arduino board to pc.

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

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\User\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Users\User\AppData\Local\Temp\arduino_build_99419 -warnings=default -build-cache C:\Users\User\AppData\Local\Temp\arduino_cache_408760 -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:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.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\User\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=1A86_7523 -ide-version=10809 -build-path C:\Users\User\AppData\Local\Temp\arduino_build_99419 -warnings=default -build-cache C:\Users\User\AppData\Local\Temp\arduino_cache_408760 -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:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.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=10809 -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\User\AppData\Local\Temp\arduino_build_99419\sketch\Blink.ino.cpp" -o nul
Error while detecting libraries included by C:\Users\User\AppData\Local\Temp\arduino_build_99419\sketch\Blink.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=10809 -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\User\AppData\Local\Temp\arduino_build_99419\sketch\Blink.ino.cpp" -o "C:\Users\User\AppData\Local\Temp\arduino_build_99419\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.

A search shows that several times after we've suggested doing that there was no further response on the Forum thread, which could be seen as a sign of success.

I also found this solution:
https://forum.arduino.cc/index.php?topic=600236.msg4150882#msg4150882

Hi pert, so you suggest me to use the GCC compiler to upload the sketch to the arduino board without arduino IDE?

No. First, the GCC compiler is only used to compile the sketch. It can't be used to upload. AVRDUDE is used to upload and AVRDUDE has nothing to do with GCC. Second, I am in no way suggesting that you don't use the Arduino IDE.

Pert, for the step that delete all the files in the Arduino15 file except the preferences right?? is it correct ?? Like this... i send the photo that i try to use the solution that you gave last few days ago.

One more thing is the for the last two steps, restart the Adruino IDE ( this step i already go through it) and for the verification of board , is it just connect the arduino to pc and without go to Tools > Boards Manager.
Right?? so the Arduino IDE of PC will able to verify the Arduino Uno (made in China) by itself and to make it successfully t verify and upload to Arduino Board ?

Jackson3089:
Pert, for the step that delete all the files in the Arduino15 file except the preferences right?? is it correct ?? Like this... i send the photo that i try to use the solution that you gave last few days ago.

You can try that, but from the output you posted after I provided those instructions I can see that the toolchain bundled with the Arduino IDE installation is in use, rather than a toolchain installed under the Arduino15 folder, so it probably won't help.

Jackson3089:
One more thing is the for the last two steps, restart the Adruino IDE ( this step i already go through it) and for the verification of board , is it just connect the arduino to pc and without go to Tools > Boards Manager.
Right?? so the Arduino IDE of PC will able to verify the Arduino Uno (made in China) by itself and to make it successfully t verify and upload to Arduino Board ?

No. By "verify", I just meant to compile a sketch (Sketch > Verify/Compile). You don't need to have an Arduino board plugged into your computer to do that.

Please try temporarily disabling your antivirus software for a single compilation as I suggested in my last reply.

Pert, the result still same after the step while the antivirus is deactivated.

Error message from Arduino IDE
Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno"

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\User\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10809 -build-path C:\Users\User\AppData\Local\Temp\arduino_build_315472 -warnings=default -build-cache C:\Users\User\AppData\Local\Temp\arduino_cache_323181 -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:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.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\User\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10809 -build-path C:\Users\User\AppData\Local\Temp\arduino_build_315472 -warnings=default -build-cache C:\Users\User\AppData\Local\Temp\arduino_cache_323181 -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:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.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=10809 -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\User\AppData\Local\Temp\arduino_build_315472\sketch\Blink.ino.cpp" -o nul
Error while detecting libraries included by C:\Users\User\AppData\Local\Temp\arduino_build_315472\sketch\Blink.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=10809 -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\User\AppData\Local\Temp\arduino_build_315472\sketch\Blink.ino.cpp" -o "C:\Users\User\AppData\Local\Temp\arduino_build_315472\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.

Try the solution provided at:
https://forum.arduino.cc/index.php?topic=600236.msg4150882#msg4150882

You'll find the environment variables listed in Windows Control Panel > System and Security > System > Advanced system settings > Advanced > Environment variables.... You can delete them there.

Pert, i have a little bit confuse on this statement ( i send u a pic in png form named untitled ) because i read through that carefully but haven't come a solution.

Secondly, i also try the other method that you suggested to me but it don't show the Arduino15 file in the Users variables for User and i also try browse file doesn't find the Arduino15 ( i send u a pic in png form named untitled2 )

In Windows Control Panel > System and Security > System > Advanced system settings > Advanced > Environment variables..., do you see "GCC EXEC PREFIX" listed under "System Variables"? Your screenshot doesn't show the entire list of system variables.

Hi pert, sorry for the late replied. I found the " GCC EXEC PREFIX " In Windows Control Panel > System and Security > System > Advanced system settings > Advanced > Environment variables. Thanks...

So i should delete this variable and open the Arduino IDE to compile /verify the sample code again to check whether the error still appear right ???

I have send the GCC.PNG in image for your as reference.

Great! I'm glad you found it. Yes, please delete that.

Pert, thanks for helping me ..... thank you very much.... :slight_smile: :slight_smile:

You're welcome. I'm glad to hear it's working now. I was a bit unclear about how to do this fix because it came from someone else with somewhat vague instructions and I had never investigated it very thoroughly. Now that I've gone through this process, I'll be able to provide more clear instructions to the next person who encounters this error.

Enjoy!
Per

Thank you. This worked for me too.

You're welcome. I'm glad if I was able to be of assistance.
Regards,
Per

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