Pages: [1]   Go Down
Author Topic: NewSoft Serial compiling Errors  (Read 8535 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to install an xbee module on a project I downloaded the NewSoftSerial from the arduino libary link and unzipped it to the libary folder everything i try even the examples give me this compiling error

"In file included from AtCommand.cpp:21:
C:\zippy1\ardu\arduino-1.0\libraries\NewSoftSerial/NewSoftSerial.h:71: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
C:\zippy1\ardu\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
"
Can anyone tell me what i am doing Wrong
Logged

Wisconsin-USA
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am also having the same problem with GPS/ LCD sketch that I am trying to compile:

"
In file included from srjGPS_Play2.cpp:18:
C:\Program Files\arduino-1.0-windows\arduino-1.0\libraries\NewSoftSerial/NewSoftSerial.h:71: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
C:\Program Files\arduino-1.0-windows\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
"
Logged

Wisconsin-USA
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In researching this, I came across a note in the 1.0 ReleaseNotes stating:

 "The SoftwareSerial class has been reimplemented, using the code originally written for the NewSoftSerial library by Mikal Hart. "

On a hunch, I replaced the "NewSoftSerial" references in my code with the updated "SoftwareSerial" references.

Example:   from   "#include <NewSoftSerial.h>"   to   "#include <SoftwareSerial.h>" (be sure to change all references in your code)

I am now able to get a successful compile.

I have yet to upload and try, but at least I have managed to compile without error.  -stef

update: Success on upload and execute.
« Last Edit: December 28, 2011, 04:27:52 am by stef » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I also noticed on the Arduino site that if you are using the V1.0 IDE and you have a reference to

#include <WProgram.h>

in any of your library .h or .cpp files, these references must be changed to

#include <Arduino.h>.
Logged

Wisconsin-USA
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I also noticed on the Arduino site that if you are using the V1.0 IDE and you have a reference to

#include <WProgram.h>

in any of your library .h or .cpp files, these references must be changed to

#include <Arduino.h>.

You are correct, I failed to mention that. Thanks for adding.  -stef
Logged

Sri Lanka
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Um using Arduino IDE 1.0.1 and um also getting this error. I can not do anything to avoid it please help.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you are using IDE 1.0, then you should be using SoftwareSerial, not NewSoftSerial.
Logged

Murbach - Alsace - France
Offline Offline
Newbie
*
Karma: 1
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am in the same situation.
IDE 1.0.2 ; Xbee modules ;
I have switched every NewSoftSerial in all librairies (SoftwareSerial.cpp +.h)
I do not have WProgram.h
and every time the same compiling error,  as Billcoste and Stef.

In fact, i think i'm lost. smiley-confuse

what is wrong ?
Thank you in advance
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey.............m facing similar problem with Arduino UNO.....
Im getting the following error while compiling:
error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
and
 error:   overriding 'virtual size_t Print::write(uint8_t)'


My commands are as follows:
#include <Wire.h>

#include <NewSoftSerial.h>

NewSoftSerial cell(2,3);

#define BMP085_ADDRESS 0x77 // I2C address of BMP085
const unsigned char OSS = 0; //oversampling Setting
int ac1, ac2, ac3;
unsigned int ac4;
unsigned int ac5;
unsigned int ac6;
int b1, b2, mb, mc, md;
long b5;

int i,j,k;
int index=1;
int counter=1;
int SMS_counter= 0;
int pressure_counter= 1;
float critical_height=0.50;
char recharge_centre[4] = "132";
char user[8] = "9160884";

char mobilenumber[8];
char recharge[13];
char inchar;
char Numb2[13];
char Numb1[8];
char Numb3[12];
char number [12];
void setup()
{
Serial.begin(9600);
cell.begin(9600);
Wire.begin();

delay(45000);
cell.println("AT+CMGF=1");
delay(200);
cell.println("AT+CNMI=3,3,0,0");
delay(200);
for(i=0; i!=88; i++)
{
inchar=cell.read();
Serial.print(inchar);
}
}
//////////////////////////////////////////////////////////////////////

void Extract()
{
delay(10000);
cell.print("AT+CPBR=");
cell.println(index);
delay(5000);
SMS_counter = 0;
}
//////////////////////////////////////////////////////////////////////
void Clear ()
{
for(i=0; i!=50; i++)
{
inchar=cell.read();
Serial.print(inchar);
delay(10);
}
}
//////////////////////////////////////////////////////////////////////
void SMS()
{
delay(10000);
cell.println("AT+CMGF=1");
delay(200);
cell.print("AT+CMGS=");
cell.print(uint8_t(34));
cell.print(number);

cell.println(byte(34));
delay(500);
cell.print("ALERT!! THE WATERLEVEL HAS REACHED CRITICAL HEIGHT. PLEASE EVACUATE TO HIGHER GROUNDS!!");
cell.println(uint8_t(26));
delay(5000);
}
///////////////////////////////////////////////////////////////////////
void Phonebook() // storing New Contact number
{
delay(10000);
cell.print("AT+CPBW=");
cell.print(counter);
cell.print(",");
cell.print(uint8_t(34));
cell.print(mobilenumber);
cell.print(uint8_t(34));
cell.print(",129,");
cell.print(uint8_t(34));
cell.print("aa");
cell.println(uint8_t(34));
counter ++;
}
////////////////////////////////////////////////////////////////////////
void Recharge() // SMS recharge number to user
{
delay(10000);

cell.println("AT+CMGF=1");
delay(200);
cell.print("AT+CMGS=");
cell.print(uint8_t(34));
cell.print(user);
cell.println(uint8_t(34));
delay(500);
cell.print(recharge);
cell.println(uint8_t(26));
delay(15000);
}
//////////////////////////////////////////////////////////////////////////
void loop()
{
if(pressure_counter==1)
{


}
else
{

}
}








////////////////////////////////////////// checks for *123 or *124 or *125




























/////////////////////////////////////////////////////////////////////////////////////////////////////////////


























































Pliz help.............
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What the heck are all those blank lines? Attention-seeking?

Read this before posting a programming question

How to use this forum


Code tags, thanks. And get rid of the blank lines.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The answer is the same for you as for the others in this thread. DO NOT USE NewSoftSerial with 1.0+. If you don't like that answer, get over it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
70 year old ambitious learner my friends reckon I am a "know all" so if you want to know something ask me
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hiya i get the same error when verifying  HelloWorld.pde and i am using arduino 1.5.4.

In file included from HelloWorld.pde:3:
C:\Users\Me\Desktop\multiarduino\arduino-1.5.4\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:81: error: conflicting return type specified for 'virtual void LiquidCrystal_I2C::'
C:\Users\Me\Desktop\multiarduino\arduino-1.5.4\hardware\arduino\avr\cores\arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'

I have checked C:\Users\Me\Desktop\multiarduino\arduino-1.5.4\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h: line 81 and there is no reference to  write(uint8_t)

any help much appreciated
Darryl
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

See reply #10.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Starting with 1.0, the default extension for Arduino files is .ino. That you are f**king around with a .pde file should be a clue by 4 that you are dealing with an old library.

Either figure out, based on the bazillions of posts in the past, how to find a newer version or upgrade an older version of the library, or quit using the library. Your choice.
Logged

Pages: [1]   Go Up
Jump to: