It's been about a week of struggle and i'm throwing in the towel. I've found several seemingly similar issue on forums, but none of which have lead to a fix.
I've been using 1.8.5 for weeks and arduino for years, then all of a sudden i started receiving the following error message. To be honest, the error message below is not the original one i received, but it's message is the same. The following error message is received when i simply opened the examples->basics->blink sketch and tried to compile/verify. The same error message is received for any example i open or any of my old working sketches.
What is even more mind boggling is that i've completely uninstalled the environment. First a standard uninstall, then i deleted the remnants in "program files (x86)" and "App Data". I also removed atmel studio in disparity and uninstalled all the atmel studio drivers.
I did this a few times trying to re-install 1.8.5 and also 1.8.4.
Any thoughts or other places to start the debugging process at?
__vector_16' referenced in section .vectors' of c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr5/crtatmega328p.o: defined in discarded section `.text' of wiring.c.o (symbol from plugin)
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
spycatcher2k:
Then why the heck are you installing Arduino?
Fair question based on my choice of words, although not exactly contributing towards a solution, lol. Arduino is among a small list of approved third party software i can install.
I don't have an answer but I loaded the blink example and compiled it. I have Windows 10 with Arduino IDE 1.8.5 installed to whatever default directory it wanted.
I notice my compiler output after Linking everything together.... is much different from yours. Are you perhaps installing the IDE is an alternate directory?
My output:
Linking everything together...
"C:\Users\john\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\john\AppData\Local\Temp\arduino_build_82595/Blink.ino.elf" "C:\Users\john\AppData\Local\Temp\arduino_build_82595\sketch\Blink.ino.cpp.o" "C:\Users\john\AppData\Local\Temp\arduino_build_82595/core\core.a" "-LC:\Users\john\AppData\Local\Temp\arduino_build_82595" -lm
"C:\Users\john\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Users\john\AppData\Local\Temp\arduino_build_82595/Blink.ino.elf" "C:\Users\john\AppData\Local\Temp\arduino_build_82595/Blink.ino.eep"
"C:\Users\john\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom "C:\Users\john\AppData\Local\Temp\arduino_build_82595/Blink.ino.elf" "C:\Users\john\AppData\Local\Temp\arduino_build_82595/Blink.ino.hex"
Sketch uses 928 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.