avr-g++: no such file or directory

Hello, no one cares but my name is bruno, I am an engineer student in belgium and I have some troubles using my arduino Uno.

whatever I do, even if my program is correct (I tried with the original "blink" program as well) if I verify my program or if I try to upload it on my arduino (I don't know if "upload" is the right word, english is not my mother tongue, sorry! but whatever, you got it) I get this error message.

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

Erreur de compilation pour la carte Arduino/Genuino Uno

(translate this last line by "compilation error for arduino bla-bla-bla")

apparently, my avr-g++ file is missing. and nothing works. (It actually never worked)

I already tried to reinstall the Arduino.app, but doesn't help.

I'm working on mac High sierra 10.13.4 and with the version 1.8.5 of the arduino app

does anybody here know what I can do?

little note: I'm a real noob with computers... you should know that before helping me! :sweat_smile:

love you all

2 Likes

Hi Bruno. Welcome!

Try doing this:

  1. Select Tools > Board > Boards Manager from the Arduino IDE menus.
  2. Wait for the updates to finish.
  3. From the list of available boards platforms, click on "Arduino AVR Boards".
  4. From the dropdown menu select "1.6.20"
  5. Click the Install button.
  6. Wait for installation to finish
  7. Click the Close button.

Now try compiling again.

3 Likes

Hello pert! thank you for this quick answer!

sadly nothing changed... I still have that error message. I just installer version 1.6.21 of "Arduino AVR Boards"

fork/exec /Users/brunoloverius/Library/Arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++: no such file or directory
Erreur de compilation pour la carte Arduino/Genuino Uno
(translate this last line by "compilation error for arduino bla-bla-bla")

OK, let's try some drastic action. Be aware this is somewhat advanced and will remove any boards you have installed via Boards Manager:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Click the link on the line following More preferences can be edited directly in the file.
    This will open the /Users/brunoloverius/Library/Arduino15 folder.
  3. Delete all files and folders under the Arduino15 folder except for preferences.txt
    :warning: Please be very careful when deleting things from your computer. When in doubt, back up!
  4. Restart the Arduino IDE.

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

1 Like

Done! And it kinda worked!

I can now verify my program.
but when I try to upload it to my arduino, I have another message... more like lot of other messages!

something about avrdude.

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/brunoloverius/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.usbmodem1411
Using Programmer : arduino
Overriding Baud Rate : 115200
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.4
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "/var/folders/4j/jnklqfnx3gn8xgvnvp1vs4q40000gn/T/arduino_build_444240/Blink.ino.hex"
avrdude: writing flash (928 bytes):

Writing | ################################################## | 100% 0.17s

avrdude: 928 bytes of flash written
avrdude: verifying flash memory against /var/folders/4j/jnklqfnx3gn8xgvnvp1vs4q40000gn/T/arduino_build_444240/Blink.ino.hex:
avrdude: load data flash data from input file /var/folders/4j/jnklqfnx3gn8xgvnvp1vs4q40000gn/T/arduino_build_444240/Blink.ino.hex:
avrdude: input file /var/folders/4j/jnklqfnx3gn8xgvnvp1vs4q40000gn/T/arduino_build_444240/Blink.ino.hex contains 928 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.13s

avrdude: verifying ...
avrdude: 928 bytes of flash verified

avrdude done. Thank you.

That's fine. It just means the program was successfully uploaded to your Arduino board. avrdude is the tool used to do that.

whell that's great then!

(I told you it was totally new for me! :slight_smile: )

Thank you very much pert and have a nice day!

Thank you for this! I've been trying to find this for weeks whilst using codebender instead. This is the only method that worked for me on mac with g++ missing file error.

Helped me either! I also got stuck when I've installed the new version 1.8.7 and updated the Arduino AVR Boards to 1.6.23 on my mac. By reinstalling version 1.6.20 everything is working fine again. Thank you!

Hi, just a quick thank you to Pert for the solution to the fork/user g++ compile problem.
I hav e no idea why I got into the mess but following the “Drastic Action” did the trick.
Ted

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

This worked for me, but just "1.6.20" version, when I try .21 or .22 version it crash.

pert:
Hi Bruno. Welcome!

Try doing this:

  • Tools > Board > Boards Manager
  • Wait for downloads to finish
  • Click on "Arduino AVR Boards"
  • From the dropdown menu select "1.6.20"
  • Click "Install"
  • Wait for installation to finish
  • Click "Close"
  • Try compiling again

MGonzalez506:
This worked for me, but just "1.6.20" version, when I try .21 or .22 version it crash.

Are you using Arduino IDE 1.8.5 still?

Hey,

had the same issue:

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

Problem solved after removing all IDEs on my system (Arduino, Python, Visial Studios).

Restarted and reinstalled Arduino, now it works.

Thank you, Pert!

You'r my savior.

It was my two weeks problem.

Nice day!

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

avr-g++: no such file or directory on DIGISPARK board on Windows 7 and 10 now this report for windows 7

i will copy the code down :

void setup() {
// initialize the digital pin as an output.
pinMode(0, OUTPUT); //LED on Model B
pinMode(1, OUTPUT); //LED on Model A or Pro
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(1, HIGH);
delay(1000); // wait for a second
digitalWrite(0, LOW); // turn the LED off by making the voltage LOW
digitalWrite(1, LOW);
delay(1000); // wait for a second
}

/////////////////////////////////////////////////////////////////

i will copy error message down :

Arduino: 1.8.9 (Windows 7), Board: "Digispark (Default - 16.5mhz)"

C:\Program Files\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\Arduino\hardware -hardware C:\Users\AAa\AppData\Local\Arduino15\packages -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -tools C:\Users\AAa\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\AAa\Documents\Arduino\libraries -fqbn=digistump:avr:digispark-tiny -ide-version=10809 -build-path C:\Users\AAa\AppData\Local\Temp\arduino_build_954010 -warnings=none -build-cache C:\Users\AAa\AppData\Local\Temp\arduino_cache_666978 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.micronucleus.path=C:\Users\AAa\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.0a4 -prefs=runtime.tools.micronucleus-2.0a4.path=C:\Users\AAa\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.0a4 -prefs=runtime.tools.avr-gcc.path=C:\Users\AAa\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5 -prefs=runtime.tools.avr-gcc-4.8.1-arduino5.path=C:\Users\AAa\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5 -verbose C:\Users\AAa\Desktop\Start-digispark-led\Start-digispark-led.ino
C:\Program Files\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files\Arduino\hardware -hardware C:\Users\AAa\AppData\Local\Arduino15\packages -tools C:\Program Files\Arduino\tools-builder -tools C:\Program Files\Arduino\hardware\tools\avr -tools C:\Users\AAa\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files\Arduino\libraries -libraries C:\Users\AAa\Documents\Arduino\libraries -fqbn=digistump:avr:digispark-tiny -ide-version=10809 -build-path C:\Users\AAa\AppData\Local\Temp\arduino_build_954010 -warnings=none -build-cache C:\Users\AAa\AppData\Local\Temp\arduino_cache_666978 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.micronucleus.path=C:\Users\AAa\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.0a4 -prefs=runtime.tools.micronucleus-2.0a4.path=C:\Users\AAa\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.0a4 -prefs=runtime.tools.avr-gcc.path=C:\Users\AAa\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5 -prefs=runtime.tools.avr-gcc-4.8.1-arduino5.path=C:\Users\AAa\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5 -verbose C:\Users\AAa\Desktop\Start-digispark-led\Start-digispark-led.ino
Using board 'digispark-tiny' from platform in folder: C:\Users\AAa\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7
Using core 'tiny' from platform in folder: C:\Users\AAa\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7
Detecting libraries used...
"C:\Users\AAa\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10809 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\AAa\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\AAa\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "C:\Users\AAa\AppData\Local\Temp\arduino_build_954010\sketch\Start-digispark-led.ino.cpp" -o nul
Error while detecting libraries included by C:\Users\AAa\AppData\Local\Temp\arduino_build_954010\sketch\Start-digispark-led.ino.cpp
Generating function prototypes...
"C:\Users\AAa\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10809 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\AAa\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\AAa\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "C:\Users\AAa\AppData\Local\Temp\arduino_build_954010\sketch\Start-digispark-led.ino.cpp" -o "C:\Users\AAa\AppData\Local\Temp\arduino_build_954010\preproc\ctags_target_for_gcc_minus_e.cpp"
avr-g++: error: CreateProcess: No such file or directory

exit status 1
Error compiling for board Digispark (Default - 16.5mhz).

waldzayed:
avr-g++: no such file or directory on DIGISPARK

Did you try following the advice I provided already in this thread?:

pert:
OK, let's try some drastic action. Be aware this is somewhat advanced and will remove any boards you have installed via Boards Manager:

  • Click the link on the line following File > Preferences > More preferences can be edited directly in the file. This will open the /Users/brunoloverius/Library/Arduino15 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.

1 Like

Thanks so much PERT!!!

been pulling out my hair on this one, but your drastic fix worked. whew.

You're welcome. I'm glad to hear it's working now. Enjoy!
Per