Problems in Serial.begin


I'm trying to keep up to date with svn repository, which at this time is at revision 1099. I'm usiing CLI.

The problem comes when I try to compile something with Serial.begin inside setup(), like this:

void setup() {

The error:

[code] dbolgheroni@mob-compaq:~/tcc/arduino/projects/perlduino$ make test -d applet || mkdir applet echo '#include "WProgram.h"' > applet/perlduino.cpp cat perlduino.pde >> applet/perlduino.cpp cat ../../libs/hardware/cores/arduino/main.cpp >> applet/perlduino.cpp /usr/local/bin/avr-g++ -mmcu=atmega2560 -I. -DF_CPU=16000000 -I../../libs/hardware/cores/arduino -Os -o applet/perlduino.elf applet/perlduino.cpp -L. applet/core.a -lm applet/core.a(Print.o): In function Print::print(String const&)': Print.cpp:(.text+0xa6): undefined reference toString::operator const' *** Error code 1

Stop in /home/dbolgheroni/tcc/arduino/projects/perlduino (line 202 of BSDmakefile). dbolgheroni@mob-compaq:~/tcc/arduino/projects/perlduino$ [/code]

This doesn't happen if I remove Serial.begin, nor if I use a more ancient revision (like revision 808).

What's wrong with Serial.begin in newer revisions? Can't figure it out by just looking at the error message.

Thank you.

If you have the String Library installed, remove it.

The problem isn't with String. It's with Print.

How do you arrive at that conclusion?

The relevant part of the error message is this:

In function Print::print(String const&)': undefined reference toString::operator const'

The first part of the message is telling you that the Print::print method that prints a string is the source of the problem.

The second part of that message is telling you what the problem is. The Print::print method is invoking a function (String::operator[]) that does not exist.

There has been a major change in the String class. It is likely that you are working with an older version of the String class and a newer version of the Print class that expects certain behavior from the String class, and that behavior is not present in the String class you have.