It looks like the library containing the definition of "main" (Arduino core) is linked before the library that references "main" (crtlib?). Since the 'main' is not yet referenced, that object file is not linked in.
I wonder if putting this line in your sketch would help:
What is your environment? (OS, OS version, how the IDE was installed, etc.)
Probably you need to completely clean out the current bad installation before re-installing, and that's more difficult than it could be, since in some OSes various pieces are scattered all over the place.
Hi, I don't know why this problem occurs. If you search google with undefined reference to `main’ keywords, you will find similar posts.
My OS is windows10, arduino version IDE is 1.8.19
I tried cleaning the arduino completely. I removed Arduino IDE, C:\Users(USER_ID)\AppData\Local\Arduino15, C:\Users(USER_ID)\AppData\Local\Temp(arduino temp folders...) and