Hello, i want to compile a sketch with some serial stuff in the code.
I already compiled the code and it is working, so the code is fine.
Im now on another pc (ubuntu 10.4) where there is no arduino in the repositories.
i downloaded arduino and installed avr-gcc libc-avr and avrdude
When compiling the sketch i get the error:
error: 'serial' was not declared in this scope
when i comment out the
#include <HardwareSerial.h>
it seems to work so there is some linking problem??
The compiler is case sensitive, so make sure that all instances of your serial int are the same case, and make sure you've initialised it before you're using it.
For example, you can't:
serial = 0;
before you've done,
int serial = 0;
goaran:
Hello, i want to compile a sketch with some serial stuff in the code.
What sketch? What stuff? My poor, tired eyes can't see the code from here.
goaran:
I already compiled the code and it is working
What system did you already compile it on? What version of Arduino?
goaran:
...so the code is fine.
Maybe...maybe not...
goaran:
when i comment out the #include <HardwareSerial.h>...
<HardwareSerial.h> is part of the Arduino core distribution libraries. You do not have to explicitly include it in your sketch (and if you do, with the current Arduino release it screws the pooch).
If you have Serial.begin(whatEver); in your code, the Serial stuff is automatically linked in (a global HardwareSerial object named Serial is instantiated for you---use it). Look at examples in the current Arduino distribution and/or the Arduino playground and reference sites.
So:
How about posting the misbehaving sketch??? If we could see it, maybe someone could actually help.
Regards,
Dave