Go Down

Topic: Compiling Errors on Uno (Read 2 times) previous topic - next topic

allnu2me

:smiley-red: I have a new Uno board, running Mac OSX 10.7.4 (Lion) on a Mac Mini. Everything seems to connect, but it starts to upload then gets 'undefined reference to setup' and undefined reference to loop' compiling error message. Tried it on another Mac running Leopard, same messages. Tried it on PC running Windows XP- dittoGet green light and blinking yellow and it starts to load, so it doesn't appear to be a connection problem per se. HELP!

Coding Badly


What are you trying to upload?  Something you've written?  One of the examples?

allnu2me

Just trying to upload the initial sketch to run a robot.

Coding Badly


allnu2me

Sorry. Like my username, it's all new to me. I built the Popular Mechanics 'Build You're First Robot'. The Arduino Uno is the suggested board. Robot is done but the initial upload for the Uno gets the errors mentioned, so it has never loaded a sketch. Tried all the suggestions in troubleshooting. It seems to physically connect OK but it starts to compile,then about halfway through, it stops with the error message.
core.a(main.cpp.o): In function `main':
/Users/bobserver/Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:11: undefined reference to `setup'
/Users/bobserver/Desktop/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:14: undefined reference to `loop





Coding Badly

Like my username, it's all new to me.


I know.   ;)

A sketch must have two functions... setup and loop.  In other words, this is the smallest possible sketch that can be uploaded (you may want to try uploading it)...

Code: [Select]
void setup( void )
{
}

void loop( void )
{
}


The sketch you are trying to upload does not have either of those functions.

Quote
I built the Popular Mechanics 'Build You're First Robot'.


This?
http://www.popularmechanics.com/technology/engineering/robots/build-your-first-robot

Is this the sketch you are trying to upload?
http://www.robotoid.com/byfr/popmech_robot_10.zip

If not, what sketch are you trying to upload?  (please wrap code in [code] [/code] tags)

allnu2me

Yes that is the Popular Mechanics project I built. The sketch is from the Arduino site for Mac OSX that is supposed to have basic functions. Doesn't appear to be the same as the one you sent. (Which reports errors also).
Quote









Coding Badly

The sketch is from the Arduino site for Mac OSX that is supposed to have basic functions.


Link?


allnu2me

I told you I wasn't too bright. I found out where to add the commands for the sketch. It works! Thanks for your help. Guys like me need all the help we can get and then some. 

Thanks again.

Coding Badly


I'm glad you have it working.

Go Up