📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Please place all UPS 3 Day orders by 11am ET Friday December 13 📬❄️📦
0

Setup() Error
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Setup() Error

by adambehman on Fri Nov 14, 2008 12:17 am

Why do I get this error, when compiling, when I leave out the "setup()" function?

o: In function `main': undefined reference to `setup'

Thanks,
Adam
http://abehman.com
adambehman
 
Posts: 3
Joined: Fri Nov 14, 2008 12:10 am

Re: Setup() Error

by mtbf0 on Fri Nov 14, 2008 9:31 am

because you left out the setup function.

if you don't want a setup function you must still have one, but it can be empty.
Code: Select all | TOGGLE FULL SIZE
void setup (void) {
}
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: Setup() Error

by westfw on Fri Nov 14, 2008 12:11 pm

The ardunio "run time environment" includes the standard C "main()" function, which looks like:
Code: Select all | TOGGLE FULL SIZE
main()
{
 setup();
 while (1) {
   loop();
 }
}

This is merged with your sketch before compilation, so if you don't have both loop() and setup() defined, you get a compile-time error...
westfw
 
Posts: 1585
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: Setup() Error

by adambehman on Fri Nov 14, 2008 11:49 pm

Thanks :D
adambehman
 
Posts: 3
Joined: Fri Nov 14, 2008 12:10 am

Re: Setup() Error

by adambehman on Sat Nov 15, 2008 12:16 am

thanks again....
adambehman
 
Posts: 3
Joined: Fri Nov 14, 2008 12:10 am

Please be positive and constructive with your questions and comments.