Dear sir,
I kept softwareserial.h file in the directory and the problem was solved.
Now I am getting other errors.
My code is (It is from GSM Examples in the Arduino IDE)
https://www.arduino.cc/en/Tutorial/GSMExamplesReceiveSMS
/*
SMS receiver
This sketch, for the Arduino GSM shield, waits for SMS messages
and displays them through the Serial port.
Circuit:
created 25 Feb 2012
by Javier Zorzano / TD
This example is in the public domain.
*/
// libraries
#include <GSM.h>
// PIN Number
#define PINNUMBER ""
// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;
char remoteNumber[20]; // Holds the emitting number
void setup()
{
// initialize serial communications
Serial.begin(9600);
Serial.println("SMS Messages Receiver");
// connection state
boolean notConnected = true;
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while(notConnected)
{
if(gsmAccess.begin(PINNUMBER)==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
Serial.println("Waiting for messages");
}
void loop()
{
char c;
// If there are any SMSs available()
if (sms.available())
{
Serial.println("Message received from:");
// Get remote number
sms.remoteNumber(remoteNumber, 20);
Serial.println(remoteNumber);
// This is just an example of message disposal
// Messages starting with # should be discarded
if(sms.peek()=='#')
{
Serial.println("Discarded SMS");
sms.flush();
}
// Read message bytes and print them
while(c=sms.read())
Serial.print(c);
Serial.println("\nEND OF MESSAGE");
// delete message from modem memory
sms.flush();
Serial.println("MESSAGE DELETED");
}
delay(1000);
}
Errors I am getting are
ReceiveSMS:28: error: 'GSM_SMS' does not name a type
ReceiveSMS.ino: In function 'void setup()':
ReceiveSMS:49: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
In file included from ReceiveSMS.ino:21:0:
C:\Program Files (x86)\Arduino\libraries\GSM\src/GSM.h:207:17: error: initializing argument 1 of 'virtual int GSM::begin(long int)' [-fpermissive]
virtual int begin(long baud_rate);
^
ReceiveSMS:49: error: 'GSM_READY' was not declared in this scope
ReceiveSMS.ino: In function 'void loop()':
ReceiveSMS:67: error: 'sms' was not declared in this scope
'GSM_SMS' does not name a type