Use board [Arduino Uno], all project compile failed

use board [Arduino Uno], all project compile failed. Even blink example. Without insert any board, only compile.

__vector_16' referenced in section .vectors' of c:/users/lnway/appdata/local/arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr5/crtatmega328p.o: defined in discarded section .text' of wiring.c.o (symbol from plugin) c:/users/lnway/appdata/local/arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to main'
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

Arduino IDE not supprot this board type? Can anyone help me? It drive me crasy.

Hi @lnwaycool. The cause of the error could be that something went wrong during the installation of the "Arduino AVR Boards" platform that adds support for the Arduino Uno board to Arduino IDE, leaving the platform installation incomplete or corrupted.

If so you might be able to easily fix it by using the Arduino IDE Boards Manager to uninstall and then reinstall the "Arduino AVR Boards" platform. Hopefully this time the installation will be successful. I'll provide instructions you can follow to do that. Since you didn't specify otherwise, I'll assume you are using Arduino IDE version 2.x. If you are instead using 1.x some minor adjustments would need to be made to the instructions. I can provide instructions for the 1.x IDE series if needed.

  1. Select Tools > Board > Boards Manager... from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  2. Scroll down through the list of boards platforms until you see the "Arduino AVR Boards" entry.
  3. Hover the mouse pointer over the "Arduino AVR Boards" entry.
    You will see a ●●● icon appear at the top right corner of the entry.
  4. Click the ●●● icon.
    A menu will open.
  5. Select "Remove" from the menu.
    An "Uninstall" dialog will open.
  6. Click the "YES" button in the "Uninstall" dialog.
    The dialog will close.
  7. Wait for the uninstall process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    Successfully uninstalled platform ...

  8. Click the "INSTALL" button at the bottom of the "Arduino AVR Boards" entry.
  9. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    Successfully installed platform ...

Now try compiling a sketch for the Arduino Uno board again. Hopefully this time it will work as expected.