Go Down

Topic: Compile errors in gsm-shield-arduino (Read 2054 times) previous topic - next topic

apierzch

Hi, I have just installed arduino ide and added gsm-sheild-arduino ( http://code.google.com/p/gsm-shield-arduino/ ) library to it. But when I try to verify any of the examples from GSMSHIELD I get following errors. Am I doing sth wrong? I don't have problems with other examples.
Code: [Select]

/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'char SIMCOM900::forceON()':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:19:16: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'int SIMCOM900::configandwait(char*)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:55:19: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:67:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:70:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'int SIMCOM900::readCellData(int&, int&, long int&, long int&)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:111:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:112:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:128:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'boolean SIMCOM900::readSMS(char*, int, char*, int)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:147:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:204:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'int SIMCOM900::setPIN(char*)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:267:15: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'int SIMCOM900::changeNSIPmode(char)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:287:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'int SIMCOM900::getCCI(char*)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:306:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'int SIMCOM900::getIMEI(char*)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:331:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'byte GSM::CheckRegistration()':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:469:17: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'char GSM::GetPhoneNumber(byte, char*)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:748:15: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'char GSM::WritePhoneNumber(byte, char*)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:822:15: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:824:15: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:826:15: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp: In member function 'char GSM::DelPhoneNumber(byte)':
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:878:15: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers
/usr/share/arduino/libraries/GSMSHIELD/SIM900.cpp:880:15: error: reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers

apierzch

I have found solution.
I am using arduino ide in 1.0.3 version (installed on my fedora by "yum install arduino"), but found that there is 1.5 version - but still beta.
In 1.5 there is one fix to F() function which I applied in my 1.0.3, which is one line in WString.h that needs to be changed:
Code: [Select]
#define F(string_literal) (reinterpret_cast<__FlashStringHelper *>(PSTR(string_literal)))
to
Code: [Select]
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

asimlink

I am also having trouble compiling examples of gsm-sheild-arduino ( http://code.google.com/p/gsm-shield-arduino/ ) library. I Get list of errors.

I oppened up WStrings.h file and saw the following line already there:
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

Can someone suggest what might be wrong with gsm-shield-arduino library?

regards

I'm also having this problem!

Any help would be greatly appreciated.

Here is what my errors are saying when trying to compile the TestModem example:

Code: [Select]
TestModem.ino: In function 'void loop()':
TestModem:53: error: ambiguous overload for 'operator!=' in 'IMEI != 0'
TestModem.ino:53:14: note: candidates are:
In file included from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/Print.h:38:0,
                 from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/Stream.h:24,
                 from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/HardwareSerial.h:143,
                 from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/WProgram.h:16,
                 from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/Arduino.h:1,
                 from C:\Program Files\Arduino\libraries\GSM/GSM3MobileCellManagement.h:37,
                 from C:\Program Files\Arduino\libraries\GSM/GSM.h:41,
                 from TestModem.ino:22:
C:\Program Files\Arduino\hardware\teensy\cores\teensy3/WString.h:143:16: note: unsigned char String::operator!=(const String&) const
C:\Program Files\Arduino\hardware\teensy\cores\teensy3/WString.h:144:16: note: unsigned char String::operator!=(const char*) const
C:\Program Files\Arduino\hardware\teensy\cores\teensy3/WString.h:145:16: note: unsigned char String::operator!=(const __FlashStringHelper*) const
TestModem:61: error: ambiguous overload for 'operator!=' in 'GSM3ShieldV1ModemVerification::getIMEI()() != 0'
TestModem.ino:61:27: note: candidates are:
In file included from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/Print.h:38:0,
                 from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/Stream.h:24,
                 from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/HardwareSerial.h:143,
                 from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/WProgram.h:16,
                 from C:\Program Files\Arduino\hardware\teensy\cores\teensy3/Arduino.h:1,
                 from C:\Program Files\Arduino\libraries\GSM/GSM3MobileCellManagement.h:37,
                 from C:\Program Files\Arduino\libraries\GSM/GSM.h:41,
                 from TestModem.ino:22:
C:\Program Files\Arduino\hardware\teensy\cores\teensy3/WString.h:143:16: note: unsigned char String::operator!=(const String&) const
C:\Program Files\Arduino\hardware\teensy\cores\teensy3/WString.h:144:16: note: unsigned char String::operator!=(const char*) const
C:\Program Files\Arduino\hardware\teensy\cores\teensy3/WString.h:145:16: note: unsigned char String::operator!=(const __FlashStringHelper*) const

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy