Problem with Serial.begin in revision 1141

Hello

I am unable to compile a simple program with Serial.begin

i get this error

applet/core.a(Print.o): In function Print::print(String const&)': Print.cpp:(.text+0xa6): undefined reference to String::operator[](unsigned int) const'

Anyone able to help??

Uncommenting some lines in Print.cpp allow it to compile but it still doesn't work

Can you paste the source code of your sketch?

Which Arduino IDE version are you using? I tried with 0021. The serial functionality works well.

This problem surfaced last week. Unfortunately the schmuck failed to indicate if my suggestion helped. Regardless of the advice I give, if you get past this problem, PLEASE report back.

Remove the String library.

the sketch is simple.

void setup(){
   Serial.begin(9600);
}
void loop(){

}

i'm not using an arduino ide.. i followed the OpenBSD CLI steps and am compiling in ubuntu 10.10

Could it be a problem with the linking in the Makefile?
i had to mangle the bsdmakefile a bit but it compiles something simple with blinkin lights fine.

The problem is a String class that is out-of-date relative to Serial. You need to locate the WString.h and WString.ccp files (or corresponding object file) that don't belong and delete them.

In other words, search for WString.h in a String subdirectory. If you find one, delete it. Repeat for WString.ccp.

Ok I managed to get it to work by adding WString.cpp to the make file and also adding

extern "C" void __cxa_pure_virtual()
{
  while (1);
}

to main.cpp

now to test it serial if it is actually working.

Thank you for the follow-up.

Cool

I guess the main problem is that the makefile is not included in the SVN repo so it's probs out of sync with whats going on..

I don't know how the arduino java system works but i think it would be cool to have a Makefile in svn.

l8
Adam