got error as below how to solve

Arduino: 1.6.8 (Windows 8), Board: "Arduino/Genuino Uno"

C:\Users\Nishit\AppData\Local\Temp\build9dcd85be4977e265f93819411f2d1b16.tmp/core\core.a(main.cpp.o): In function `main':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

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

Please read the second and third posts by Nick Gammon at the top of this Forum on the proper way to post here. Be sure to use code tags when you post your code.

It would help if you had posted your code, but my crystal ball is showing that you do not have a setup() function in it. Is that correct ?

If you are using the Arduino IDE, then

You MUST have a function called setup(), even if it is empty.
You MUST have a function called loop(), even if it is empty.

vaj4088:
If you are using the Arduino IDE, then

You MUST have a function called setup(), even if it is empty.
You MUST have a function called loop(), even if it is empty.

Is this actually true ?
I believe that if you write your own main() function you don't need either of them because it supercedes the hidden main() function that calls setup() and loop().

Is this actually true ?

That depends on whether you (stupidly) call your sketch main.ino, or not. OP did.

UKHeliBob wrote:

Is this actually true ?

It is true if you are a novice that uses the Arduino IDE with its own main() that calls set() and loop().

That's why I wrote "If you are using the Arduino IDE".

As UKHeliBob wrote, it is not absolutely true, but it is true for most novices.

The comment written by PaulS is relevant also. This is such a common problem, perhaps the IDE should issue a warning when this is attempted.