harlequin-tech / WiFlyHQ

WiFly RN-XV Arduino Library
Other
110 stars 68 forks source link

Cannot compile example httpserver.ino #56

Closed Sterpa closed 8 years ago

Sterpa commented 8 years ago

I can not compile the example file httpserver.ino Gives an error message: ...WiFlyHQ-master/WiFlyHQ.h:78:28: error: section attribute not allowed for 'prog_char' typedef const char PROGMEM prog_char;

What could be the problem? the author is silent... @chrwei please help!

duhovny commented 8 years ago

Hey @Sterpa, I had same problem with the last version of Arduino IDE. Rolling back to v1.0 helped to solve this issue.

Also @chrwei has mentioned he fixed this for last version of Arduino IDE in his forked repository. I haven't tried though.

chrwei commented 8 years ago

that line does not cause problems for me in 1.6.5. I'm not sure what the issue is in this case.

Sterpa commented 8 years ago

Very strange... i use 1.6.8 and @chrwei fofk, and cannot solve this... only remark this lines with #define PROGMEM

//#undef PROGMEM 
//#define PROGMEM __attribute__(( section(".progmem.data") )) 
#undef PSTR 
#define PSTR(s) (__extension__({static prog_char __c[] PROGMEM = (s); &__c[0];})) 

but i am not shure, that it is right way. Of course rolling back to v1.0 is a wrong way, we go forward, not downshift))

chrwei commented 8 years ago

so... I followed the posted error instead of actually open the example, and removing those lines should fix it, or maybe wrap them in an ifdef so older versions still use it?

see pull request #57

harlequin-tech commented 8 years ago

Update merged, thanks. This code was an old work-around to avoid compiler warnings when using PROGMEM. Newer Arduino releases have fixed the problem.