Error Compiling on Arduino Uno

Hi !

Arduinoob here. I'm trying to compile a simple sketch and I keep getting this error :

Arduino: 1.8.16 (Windows Store 1.8.51.0) (Windows 10), Board: "Arduino Uno"

C:\Users\ZOIDBE~1\AppData\Local\Temp\ccCVydck.ltrans0.ltrans.o: In function `main':

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.51.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

And here's the sketch

I reintalled the IDE and try to find a solution online but I can't find anything useful.

Thank you !

Goose

Please do not post pictures of code
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use [color = red]code tags[/color] (the </> icon above the compose window) to make it easier to read and copy for examination

Your sketch needs to have a loop() function defined in it even if it does nothing

Add this at the bottom:
void loop() {}

Thank you !

Thank you for the fix and the info ! Seems like I will be here often.

Cheers !

@jhp_goose Try the steps below:
Step 1:
Install the package core for your board, see https://www.arduino.cc/en/Guide/Cores
For clone boards, see Using Arduino IDE with unofficial Arduino clones bearing CH340 chip | by Andrey Semenyuk | Dev Genius
Note:

  1. Use a good quality data USB cable and do not use a USB hub or USB 3.0 port.
  2. Remove anything wired to the board.

Step 2: Boatloader mode option:

  1. Double tap the reset button on your board quickly. You should now see the LED on the board pulsing (fade in and out slowly), which means the bootloader is running. The double press/tap makes the bootloader to run indefinitely (until the board is reset by taping again the rest button once, powered off, or an upload is done).
  2. Select the COM port for the board from the Tools > Port menu. The port number is usually different when the bootloader is running.
  3. Start compile and upload a Blink LED sketch from the Arduino IDE examples.

Once the upload finish successfully, you should now be able to program the board normally without the need to put the board in boatloader mode.

Note: do not use your own code when the board is in bootloader mode.

For an Uno ?

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