problem using GSM shield and GPS shield in one arduino UNO R3

i try to program use the GSM shield arduino with arduino UNO i did it successfully but after that i try to use GPS shield but when i add the #include <SoftwareSerial.h> for the program i got the error

here is the code make the program error

#include <GSM.h>
#include <TinyGPS.h>
#include <SoftwareSerial.h> // when i add that one i got the output eroor 
// PIN Number for the SIM
#define PINNUMBER ""

i got this error out put

Arduino: 1.6.6 (Mac OS X), Board: "Arduino/Genuino Uno"

libraries/SoftwareSerial/SoftwareSerial.cpp.o: In function `__vector_3':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:227: multiple definition of `__vector_3'
libraries/GSM/GSM3SoftSerial.cpp.o:/Applications/Arduino.app/Contents/Java/libraries/GSM/src/GSM3SoftSerial.cpp:499: first defined here
libraries/SoftwareSerial/SoftwareSerial.cpp.o: In function `SoftwareSerial::read()':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of `__vector_4'
libraries/GSM/GSM3SoftSerial.cpp.o:/Applications/Arduino.app/Contents/Java/libraries/GSM/src/GSM3SoftSerial.cpp:487: first defined here
libraries/SoftwareSerial/SoftwareSerial.cpp.o: In function `SoftwareSerial::read()':
/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of `__vector_5'
libraries/GSM/GSM3SoftSerial.cpp.o:/Applications/Arduino.app/Contents/Java/libraries/GSM/src/GSM3SoftSerial.cpp:487: first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

any help and advice thanks :slight_smile:

The GSM library you're using has it's own software serial implementation which uses the same PCINT vectors that the normal software serial library uses.

You need to use a different GSM library that works with the software serial library, or a different software serial library (it's possible to make one that uses the analog comparator interrupt).

That said, there's a fundamental limitation here, that I think could sink your plans. Software serials, whether the GSM one or SoftwareSerial library, are highly limited. Only one operation (sending or receiving) can happen at a time, and on only one software serial. Otherwise, you'll get gibberish on both. So if your GPS is blasting out data nonstop as GPS's are wont to do, you can't talk to the GSM without disabling the GPS's software serial, and viseversa.

The way around this is to use a chip with multiple hardware serial ports - like the Mega (4 ports) or the 1284p (2 ports), so you need at most one software serial.

thanks , it is possible to use the GSM serial software library for GPS or how can i solve this problem

Use a card that combines the 2 over 1 serial port.
www.dfrobot.com. Search for SIM908
http://www.dfrobot.com/index.php?route=product/product&product_id=673&search=sim908&description=true