core.a(main.cpp.o): In function main': F:\Arduino and Processing\arduino-1.0\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to setup'
F:\Arduino and Processing\arduino-1.0\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'
I don't know. I just compiled your code (which should be wrapped in ... tags) without any trouble. I would guess there is something wrong with your installation. Can you compile any of the example sketches?
there's something up with this code or something. i'm having the same problem with the Tone tutorial. i've been working with the arduino for a couple of months, and this is the first time i've seen this error. i wiped the IDE from my computer and redownloaded the same version, and i got the same error.
for what it's worth, i'm on a PC using windows 7.
if anybody can look into this and figure it out, that would be super great. i was really looking forward to using this tutorial to play different tunes.
i'm using the code from the tutorial. i've seen this issue - with the Tone tutorial - posted on other forums, and people trying to help have also been unable to replicate the problem. it's weird.
are you on a mac or PC?
No problem with Windows 7 (64 bit). This is what I did...
• Start Arduino IDE
• Navigate to the tone tutorial using my favourite web browser
• Click the first [Get Code] link...
• Press Ctrl + A to select the text
• Press Ctrl + C to copy the text
• Switch to the Arduino IDE
• Press Ctrl + V to paste
• Click the down-pointing arrow on the right side to display the Tab Menu
• Click New Tab
• Enter pitches.h and click OK
• Switch to the web browser
• Go back to the tutorial
• Click the second [Get Code] link...
• Press Ctrl + A to select the text
• Press Ctrl + C to copy the text
• Switch to the Arduino IDE
• Press Ctrl + V to paste
• Press Ctrl + R to verify
so i did it exactly the way you typed it out (using keyboard shortcuts and all) and found myself verifying the pitches.h file - which compiled. so then i changed tabs to verify the tone code.... and it compiled! and then i uploaded it, which went fine.
so does the moral of the story here state that i was supposed to compile pitches.h? would that have anything to do with it?
thanks a bunch for your help!
bethlena:
so does the moral of the story here state that i was supposed to compile pitches.h?
I'm guessing you're rather new to the world of compiled programming languages1. When you Verify or Upload, various bits are combined together ultimately becoming an "upload image"2. In compiled language parlance this is called a "build". While both the sketch tab and the pitches.h tab are included in the build, only the sketch tab is fed directly to the compiler. pitches.h is included indirectly / by reference.
In other words, it makes no difference which tab has the focus. Only the sketch (the "main" tab) gets fed to the compiler. You do not need to compile the other tabs (like pitches.h) before compiling the sketch tab.
would that have anything to do with it?
No. At this point my suspicion is that the error message you encountered was a bit different than the original error message. Precision with error messages is very (annoyingly!) important.
thanks a bunch for your help!
You are welcome! Enjoy!
1 This is not meant as an insult but merely an observation and precursor. 2 Other names are also used. HEX-file is a fairly common synonym.