Shop OBEX P1 Docs P2 Docs Learn Events
Software compiling problem — Parallax Forums

Software compiling problem

CrosswaysCrossways Posts: 8
edited 2013-02-15 22:32 in General Discussion
I'm still debugging the Altimeter setup. I've got some of it working, but with strange resuls. I made some wiring changes and upplugged the board so I could upload again to see if that made any difference. I then got the following ' Error Compiling'.

core.a(main.cpp.o): In function `main':
C:\Users\Dave\Downloads\Arduino Altimeter\arduino-1.0.3-windows\arduino-1.0.3\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to `setup'
C:\Users\Dave\Downloads\Arduino Altimeter\arduino-1.0.3-windows\arduino-1.0.3\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'

I had something like this happen when I first started out this morning and I had to go back and upzip the files to a new folder even though the program loaded ok yesterday. I don't want to have to keep doing that - any thoughts?

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-02-14 22:09
    Well, this is rather tricky in Arduino.

    In C, the main() is where a program starts, but Arduino actually hid the main() from the user's text in its programs and adds it as you compile. This is a very non-standard feature of Arduino that creates the impression in the user that they are using something easier than C... when C is rather easy in and of itself.

    If main() is missing or cannot be located, nothing runs. I really don't know enough about Arduino to help you. There is plenty to learn in just plain old C.

    If you really want to get away from repeated problems --- seek Arduino support in groups that really know Arduino or just write new code and compile AVRs directly in C. Or, get a Propeller and use C with it.
  • CrosswaysCrossways Posts: 8
    edited 2013-02-15 09:06
    G. Herzog in:Thank you for your response. The odd thing is that when I loaded the program it seem to run, however, when I tried to compile it, I got the errors mentioned above. Also, the program comes in without showing any code. All I see at the top is a tab - 'Sketch feb15a'. I know I'm way over my head in this project, but I think I'm close to getting things working. When I monitor the serial port, is shows: (Centimeters: -29408.00, Feet: -964.83). Not sure why the minus sign is in there, but it might be correct. I live just off the top of a 1100 foot hill, so it might be right. The LCD board displays this information wrapped in a crazy way, so I have a lot to sort out. I think you're right about getting on a Arduino forum, I'll try that next. Thanks again for responding. Dave
  • jazzedjazzed Posts: 11,803
    edited 2013-02-15 09:46
    Without knowing much about the Arduino I'm really sticking my neck out trying to help, but I'll try anyway ... I would have to guess that your new program is not being loaded. Not having references to setup() and loop() sounds like you need to add code somehow.

    Have you tried the Arduino forums? People tend to go to great lengths to be helpful here, but it may be possible to get better/faster answers to your Arduino questions on the Aduino forum. http://arduino.cc/forum/
  • CrosswaysCrossways Posts: 8
    edited 2013-02-15 12:40
    Jazzed:

    Thanks for trying. I'm caught in a loop when I try to get on Arduino forum. It's been a couple of years, and I don't remember what my user name and password were. They'll send a new temp password,but without a user name it would go through. When I tried to just register new, it comes back and says 'one of their user already has that e-mail address :-) I'm trying to reach a human.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-02-15 22:32
    The problem you are having is quite typical of learning a new compiler as each one is different. You really need to work with the community of users that know the target compiler and its quirks. Nobody can keep track of all the software that exists.

    As for forgetting logins... we all do from time to time. I have a system where serious passwords are very unique, but when the site is not a critical security problem, I use a very easy to remember phrase that includes the site's name. That way I don't have to wait for the site to help me with a lost password. For instance, you could just add 'Buzz' to a keyword... so the Arduino site might be 'buzzarduino' and other sites would be 'buzz.......'

    And if you can't get on the forums or don't get the answers you want.... read the tutorials.
Sign In or Register to comment.