[SOLVED] problem when gsm + keypad

im having a problem with compiling keypad and gsm into a coding. there’s a coding file attached below. and actually, there’s nothing wrong with the coding, but it goes wrong when i put #include <GSM.h>. anyone can explain and solve this? please. im a newbie. thanks :smiley_cat:

In file included from C:\Program Files (x86)\Arduino\libraries\GSM\src/GSM3MobileNetworkProvider.h:37:0,

                 from C:\Program Files (x86)\Arduino\libraries\GSM\src/GSM3MobileClientService.h:37,

                 from C:\Program Files (x86)\Arduino\libraries\GSM\src/GSM.h:42,

                 from C:\Users\ASUS ROG\Desktop\Input_Number\Input_Number.ino:2:

C:\Program Files (x86)\Arduino\libraries\GSM\src/GSM3MobileAccessProvider.h:37:36: error: redeclaration of 'IDLE'

 enum GSM3_NetworkStatus_t { ERROR, IDLE, CONNECTING, GSM_READY, GPRS_READY, TRANSPARENT_CONNECTED, OFF};

                                    ^

In file included from C:\Users\ASUS ROG\Documents\Arduino\libraries\Keypad\src/Keypad.h:36:0,

                 from C:\Users\ASUS ROG\Desktop\Input_Number\Input_Number.ino:1:

C:\Users\ASUS ROG\Documents\Arduino\libraries\Keypad\src/Key.h:41:15: note: previous declaration 'KeyState IDLE'

 typedef enum{ IDLE, PRESSED, HOLD, RELEASED } KeyState;

               ^

In file included from C:\Program Files (x86)\Arduino\libraries\GSM\src/GSM.h:46:0,

                 from C:\Users\ASUS ROG\Desktop\Input_Number\Input_Number.ino:2:

C:\Program Files (x86)\Arduino\libraries\GSM\src/GSM3ShieldV1BandManagement.h:49:125: warning: 'typedef' was ignored in this declaration [enabled by default]

 typedef enum GSM3GSMBand {UNDEFINED, EGSM_MODE, DCS_MODE, PCS_MODE, EGSM_DCS_MODE, GSM850_PCS_MODE, GSM850_EGSM_DCS_PCS_MODE};

                                                                                                                             ^

exit status 1
Error compiling.

Input_Number.ino (1.75 KB)

It looks like both of the libraries declare a constant named IDLE

If you look in the GSM and GSM3MobileAccessProvider library files you will see where it is being done and the value that it is being set to. It is possible that they both use the same value, in which case you could remove the declaration from one of the files but that could cause other problems.

Have a look at the library files and report back what you find.

UKHeliBob:
It looks like both of the libraries declare a constant named IDLE

If you look in the GSM and GSM3MobileAccessProvider library files you will see where it is being done and the value that it is being set to. It is possible that they both use the same value, in which case you could remove the declaration from one of the files but that could cause other problems.

Have a look at the library files and report back what you find.

thanks for having your time to read my post. actuallyi have read some posts, and yeah im sure that im having problem on library, probably having same value, but i dont know how to solve it. so there’s file attached. gsm and keypad library.

GSM3MobileAccessProvider.h (2.32 KB)

Keypad.zip (18.4 KB)

hoping someone could help me on this

problem solved.
problem: i cant compile gsm library with keypad library.
solution: i dont use keypad library, i declare them manually instead. may search at youtube; keypad without library.