I'm having a bit of trouble with a compiling error and I'm a bit lost as to what I should do. To start, I know close to nothing about programming/programming languages. However, I am trying to make an Arduino weather station as a gift for my husband (project GitHub is located here.) and I'm stuck at an undefined setup / undefined loop error. Here is the code that I downloaded from the GitHub:
For the record, I have searched on the issue and I do understand that the code needs to have a loop/setup void included since the .cpp file calls for those. However, no matter where I try to place a void, the errors continue. For example, I've tried putting it at the beginning, like this:
I've tried placing it elsewhere in the code, as well, and still I get the errors. I'm certain I must be missing something incredibly simple, but my lack of knowledge with this just has me completely lost as to what to do. Any help would be greatly appreciated!
P.S. - I didn't post all of the code because it apparently exceeds the 9000 character limit. Sorry!
But I'm still getting the errors. So that leads me to believe that I'm not placing it in the correct spot or that there's something else going on. I'll have to poke around at it a bit more to see what I can figure out.
Though, to be more specific, it's from the weather-station.ino file. Maybe that's not the appropriate file for use in Sketch? As for the complete list of errors, that's really it. Just the two errors. I don't know that it helps, but here's the output anyway.
core.a(main.cpp.o): In function `main':
/usr/share/arduino/hardware/arduino/cores/arduino/main.cpp:11: undefined reference to `setup'
/usr/share/arduino/hardware/arduino/cores/arduino/main.cpp:14: undefined reference to `loop'
collect2: error: ld returned 1 exit status
Edit: Foolish me, I didn't link directly to the .ino file like I had intended. Fixed it, though!
Try attaching the code that you're trying to compile to a post as described in "How to use this forum - please read".
The weather.ino that I just picked up from your link doesn't contain anything like the code you posted in your first post. I haven't got all the libraries needed to compile it and I can't be bothered to try to find them all but it definitely does contain both setup() and loop().
Ok, so I've attached both the weather-station.ino file that I've been having the problem with and the error output when creating a new Sketch (File > New) and then running Verify/Compile. I hope this helps!
You're using an extremely outdated version of the Arduino IDE, probably because you installed it via a Linux package manager. Please download and install the official version of the Arduino IDE from:
pert:
You're using an extremely outdated version of the Arduino IDE, probably because you installed it via a Linux package manager. Please download and install the official version of the Arduino IDE from: http://www.arduino.cc/en/Main/Software
And this solved it, thank you! I had used apt-get to quickly install Arduino IDE. The newer version completely eliminates the error for me. Now I can focus on all of the other errors, hah. Thank you all so much for the help!
Glad to hear! That gets a lot of people. It's very unfortunate that the Linux packages are so out of date. To make matters worse they are modified from the original IDE so there may be bugs that we aren't familiar with.
I realized that the old IDE versions gave a blank sketch on File > New so in fact my suggested minimal test was probably a bit too minimal. In the recent versions of the Arduino IDE File > New gives the bare minimum sketch with just an empty setup and loop definition so it makes a good sanity check.
If you get stuck with any of these new errors I'm sure we can help you with. Just a hint, there are URLs where you can download the library dependencies listed in this file:
Unfortunately I didn't find that file until after I had searched all over and tried multiple e-paper libraries. The three Adafruit libraries can actually be installed via Library Manager (Sketch > Include Library > Manage Libraries) if you want an even easier installation but the e-paper library will need to be manually installed.