Compilation error: Error: 2 UNKNOWN: exit status 1

Any program I run and attempt to compile I get this error:

c:/users/anton/appdata/local/arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/…/lib/gcc/avr/7.3.0/…/…/…/…/avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main’
collect2.exe: error: ld returned 1 exit status
Compilation error: Error: 2 UNKNOWN: exit status 1

I recently got the beta and no matter what I do I had this (yes I restarted my pc) and I even download the latest Git (2.30.1) 64-bit.

What I Did:
Opened example ‘blink’ and clicked compile. Then I got this error.

My info:

  • OS: Windows 10 Pro 64-bit
  • Version of IDE: 2.0.0-beta3

Additional context
This could be due to from when some notification occurred which I couldn’t figure out what it was for. I do remember that it led to this link. However, I don’t see this notification anymore?

anthony-sharonov:
Additional context
This could be due to from when some notification occurred which I couldn’t figure out what it was for. I do remember that it led to this link. However, I don’t see this notification anymore?

I’m sure this is completely unrelated. I get this periodically also and have submitted a bug report about it:

The lead developer for the Arduino IDE 2.x informed me that this is a bug in the Theia IDE framework used by Arduino IDE 2.x:

So it will need to first be fixed in Theia, then that fix will be pulled into Arduino IDE 2.x.

Until then, please ignore this spurious “Unable to watch for file changes in this large workspace. Please follow the instructions link to resolve this issue.” message.

anthony-sharonov:
Any program I run and attempt to compile I get this error:

I see you also reported it in the issue tracker. I’ll link it here so others who are interest in this subject will have access to all the relevant information:

@pert

Thank you!

This error went away after installing the first library.