I want to use Adafruit_CC3000 arduino library in AVR Studio. I have followed this Instruction to use Adafruit arduino lib with AVR studio so i can use other AVR function too. But I am getting the same error 50 times while i compile the code.
Error 5 reinterpret_cast from type 'const char*' to type '__FlashStringHelper*' casts away qualifiers E:\arduino-1.0.1\libraries\Adafruit_CC3000\Adafruit_CC3000.cpp 183 3 ATmega32_WSClient_CC3K
I have searched on web for such kind of errors. but i failed to understand the issue. I am requesting to make me understand which thing in this code is generatig this error?
reinterpret_cast
can convert between unrelated pointer types, but can't remove const
or volatile
qualifiers. You need const_cast
for that.
Options are (roughly in order of increasing nastiness):
const __FlashStringHelper*
, if you don't need to modify the object;char*
if you do need to modify it;reinterpret_cast<__FlashStringHelper*>(const_cast<char*>(whatever))
or the brute-force (__FlashStringHelper*)whatever
if you insist on abandoning the type system entirely.