Write the following line in any of the GSM examples and see for yourself.
#include <SoftwareSerial.h>
When I compile any GSM example while including SoftwareSerial using the Arduino Mega, the following error messages appear.
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_9'
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\GSM\GSM3SoftSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_10'
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\GSM\GSM3SoftSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_11'
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\GSM\GSM3SoftSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Using library GSM at version 1.0.6 in folder: C:\Program Files (x86)\Arduino\libraries\GSM
Using library SoftwareSerial at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial
exit status 1
Error compiling for board Arduino Mega or Mega 2560.
When I compile any GSM example while including SoftwareSerial using the Arduino UNO, the following error messages appear.
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_3'
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\GSM\GSM3SoftSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_4'
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\GSM\GSM3SoftSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function `SoftwareSerial::read()':
(.text+0x0): multiple definition of `__vector_5'
C:\Users\ABDULL~2\AppData\Local\Temp\arduino_build_684123\libraries\GSM\GSM3SoftSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Using library GSM at version 1.0.6 in folder: C:\Program Files (x86)\Arduino\libraries\GSM
Using library SoftwareSerial at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial
exit status 1
Error compiling for board Arduino Uno.
Both responses are similar, just the vector numbers are different.
I have tried to find these vector definitions in various related .h and .cpp files but I could find them anywhere.
Is there any way I can use SoftwareSerial while using Arduino GSM Library?
I am using the ArduinoGSMShield and the Adafruit's Ultimate GPS shield on Arduino Mega. I think I can use the Mega's Serial1 and Serial2 for the GPS shield, but that may involve some hardware connections.