gsm receiving sms help

im new to the whole arduino world but i have been messing around with examples.
I have a tinysine gsm sim900 module and im wanting to receive texts but every example i have found and tried to use does not work. the example located here ( gives me this error when i check the code.

sketch_feb28a:60: error: ‘sms’ was not declared in this scope

and “GSM_SMS sms;” is highlighted in the code

GSM_SMS is not located in my libraries

anyone have any other code i could try?

post your code?
did you import the library?

i was able to get texts using the following code, and use AT command AT+CMGL=“ALL” to receive my messages.

#include <SoftwareSerial.h>
#include <string.h>

char incoming_char = 0;
SoftwareSerial cell(2,3);

void setup()
// Initialize serial ports for communication.

// Reset
Serial.println(“Start Reset”);
pinMode(7, OUTPUT);
digitalWrite(7, HIGH);
digitalWrite(7, LOW);
Serial.println(“End Reset”);


Serial.println(“Enter your AT commands (with CR & NL)…”);

void loop()
if(cell.available() > 0)
incoming_char =;
if((incoming_char >= ’ ') && (incoming_char<=‘z’))
Serial.print((int) incoming_char);
if(incoming_char == 10)

if(Serial.available() > 0)
incoming_char =;

Please use [code] tags, and it looks like you didn’t declare the GSM library.
Have a look at this page:
Read all the libraries, use those instead, since your code seems to be using Serial…
If you want to use your own,
Add to the top of your code:

#include <GSM.h>

and add below that these lines:

GSM gsmAccess;
GSM_SMS sms;

Try it now.