Arduino and C++17 ( AVR-GCC 8.x)

Hello, does anyone know how to compile Arduino scetches using latest C++ compiler?

I tried some builds made by Zak Kemble (Win7_32 and Win10_64) from http://blog.zakkemble.co.uk/avr-gcc-builds/ on various IDE versions 1.8.x and 1.9.beta but was getting compiler errors: “…/ar.exe: unable to rename …core.a’ ; reason: File exists” Thank you!

Antivirus is disabled, I run it as Admin, tried to put Arduino in different folders such as C:\Arduino or C:\Program files\Arduino and the same error.

Any ideas? please let me know, thank you!

Manually delete the file that it complains about.

Note that this is not specific to your compiler version, things like that have been reported before.

That error can be caused by aggressive antivirus software doing on access scanning of the intermediate files produced during the compilation process, interfering with some of the steps (due to the file being open by the av scanner)

upd: Solved: I guessed a link for earlier AVR-GCC 7.2.0 build ( http://blog.zakkemble.co.uk/download/avr-gcc-7.2.0-x86-mingw.zip ) and it works just perfect.

:slight_smile:

p.s. this file was located in ...AppData\Local\Temp folder and Arduino deletes it itself
p.p.s. "Antivirus is disabled"

Hi,

I downloaded version gcc 7.3. from the same page.
Then I set the option -std=gnu++17 in the platform.txt.
Win10, IDE v1.8.8
Blink Sketch. Compiling works. Upload but not. File avrdude.conf is also swapped. Error remains.
What else does one have to change?

Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Worker\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Worker\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Worker\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10808 -build-path C:\Users\Worker\AppData\Local\Temp\arduino_build_542072 -warnings=all -build-cache C:\Users\Worker\AppData\Local\Temp\arduino_cache_227002 -prefs=build.warn_data_percentage=75 -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 -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 -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 -hardware C:\Users\Worker\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Worker\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Worker\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10808 -build-path C:\Users\Worker\AppData\Local\Temp\arduino_build_542072 -warnings=all -build-cache C:\Users\Worker\AppData\Local\Temp\arduino_cache_227002 -prefs=build.warn_data_percentage=75 -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 -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 -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'mega' 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++17 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072\sketch\Blink.ino.cpp" -o nul
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++17 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072\sketch\Blink.ino.cpp" -o "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072\preproc\ctags_target_for_gcc_minus_e.cpp"
Sketch wird kompiliert...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++17 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10808 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\mega" "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072\sketch\Blink.ino.cpp" -o "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072\sketch\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\Worker\AppData\Local\Temp\arduino_cache_227002\core\core_arduino_avr_mega_cpu_atmega2560_0c812875ac70eb4a9b385d8fb077f54c.a
Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections,--relax -mmcu=atmega2560 -o "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072/Blink.ino.elf" "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072\sketch\Blink.ino.cpp.o" "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072/..\arduino_cache_227002\core\core_arduino_avr_mega_cpu_atmega2560_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\Users\Worker\AppData\Local\Temp\arduino_build_542072" -lm
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072/Blink.ino.elf" "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072/Blink.ino.eep"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072/Blink.ino.elf" "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072/Blink.ino.hex"
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-size" -A "C:\Users\Worker\AppData\Local\Temp\arduino_build_542072/Blink.ino.elf"
Der Sketch verwendet 1448 Bytes (0%) des Programmspeicherplatzes. Das Maximum sind 253952 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 8183 Bytes für lokale Variablen verbleiben. Das Maximum sind 8192 Bytes.
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM3 -b115200 -D -Uflash:w:C:\Users\Worker\AppData\Local\Temp\arduino_build_542072/Blink.ino.hex:i

avrdude: Version 6.3, compiled on Feb 17 2016 at 09:25:53
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Beim Hochladen des Sketches ist ein Fehler aufgetreten
avrdude: error at C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf:1133: programmer type jtagice3_updi not found
avrdude: error reading system wide configuration file "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

1 Like