PlatformIO doesn't know the SoftwareSerial.h lib

149 views Asked by At

I'm using the Adafruit_GPS.h lib, the problem ist that it doesn't know thee SoftwareSerial.h. but it's installed. The project is build on VSCode and PlaformIO. How can I fix that?

In file included from .pio/libdeps/nanoatmega328/Adafruit GPS Library/src/Adafruit_GPS 2.cpp:31:0: .pio/libdeps/nanoatmega328/Adafruit GPS Library/src/Adafruit_GPS.h:61:28: fatal error: SoftwareSerial.h: No such file or directory



compilation terminated. *** [.pio/build/nanoatmega328/libf12/Adafruit GPS Library/Adafruit_GPS 2.cpp.o] Error 1 In file included from .pio/libdeps/nanoatmega328/Adafruit GPS Library/src/Adafruit_GPS.cpp:31:0: .pio/libdeps/nanoatmega328/Adafruit GPS Library/src/Adafruit_GPS.h:61:28: fatal error: SoftwareSerial.h: No such file or directory



compilation terminated. *** [.pio/build/nanoatmega328/libf12/Adafruit GPS Library/Adafruit_GPS.cpp.o] Error 1

1

There are 1 answers

0
anima On

I found this solution on community.platformio.org (https://community.platformio.org/t/adafruit-gps-library-cannot-compile-because-softwareserial-is-missing/18703/7).

You need to comment an IF ENDIF this way:

//#if (defined(__AVR__) || defined(ESP8266)) && defined(USE_SW_SERIAL)
#include <SoftwareSerial.h>
//#endif