Compiling with version 0021

Hi All,

I have downloaded the new Arduino 0021 version and tried to compile a sketch that is already compiling and working under the Arduino 0018 version.

in this sketch i am using the libraries :
#include <Streaming.h>
#include <WString.h>
#include <EEPROM.h>

The error below is:

d:\My Documents\My Projects\Embedded_Development\Arduino\arduino-0021\libraries\String\WString.cpp:34: error: prototype for ‘String::String(int)’ does not match any in class ‘String’

And many errors follows. I there a new updated version of WString for 0021?

What is the issue here?

Regards,

Thanks ::slight_smile:

PLease share the whole code ...

#include <Streaming.h>
#include <WString.h>
#include <EEPROM.h>

int addr = 0;
int StringLen=1;
char myStrings[1]="";
char ATR_RESULT[1]="";
long Command=0;
int i=0;
long Flashlen;//=100;5
long GOODATR=20;
long BADATR=100;
int LEDPin = 13;
boolean FLED=false;
char* pntr=0;
volatile int state = LOW;
int iPIN2=2;
int MBM_ATR_SIG=0;
int R=-1;
boolean ATR_TEST_BUSY=false;

void setup(){

pinMode(iPIN2,INPUT);
Serial.begin(115200);
pinMode(LEDPin,OUTPUT);
}

void loop(){
pntr=0;
Command=0;
i=0;

MBM_ATR_SIG = digitalRead(iPIN2);
if (MBM_ATR_SIG==HIGH && ATR_TEST_BUSY==false){
//Do ATR REQUEST
RQST_ATR_TEST();
//Get Result
GetATR_RESULT();
}
FlashLED();

}

void FlashLED(){
digitalWrite(LEDPin,HIGH);
delay(500);
digitalWrite(LEDPin,LOW);
delay(500);
return;
}

void RQST_ATR_TEST(){
// noInterrupts();
ATR_TEST_BUSY=true;
Serial.flush();
Serial << “00010101\n”;
Serial.flush();
}

void GetATR_RESULT(){
Serial.flush();
int readchr=0;
memset(ATR_RESULT,0,sizeof(ATR_RESULT));
do{
if(Serial.available() > 0){
ATR_RESULT[readchr]= Serial.read();
readchr++;
}
}while(readchr<StringLen);

R= atoi(ATR_RESULT);
Serial << "\nR VAL = " << R;

switch (R){
case 0:
// digitalWrite(LEDPin,HIGH); //GOOD ATR
Serial << “\nGOOD ATR RECEIVED\n”;
ATR_TEST_BUSY=false;
break;
case 1:
// digitalWrite(LEDPin,LOW); //BAD ATR
ATR_TEST_BUSY=false;
Serial << “\nBAD ATR RECEIVED\n”;
break;
case -1:
Serial << “\nNO ATR RESPONSE RECEIVED\n”;
ATR_TEST_BUSY=false;
break;
}
loop;
}

Starting with the briefly available, and quickly superseded, version 0020, the String class was incorporated into the core. You no longer need to include WString, which is, indeed, a different String class.

It annoys me no end when file names don't match class names. Had the names matched, the WString header file would have defined the WString class, which could easily have been replaced by the String class in core. Any sketch using the old WString class would have continued to compile and link just fine.

As it is, there is a new class that is called the same thing as the old class, with different signatures for some of the methods.

Hey Pauls,

Thanks, i removed the include for the WString and it compiled.

Thanks :)