Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile example #15

Open
chiangy77 opened this issue Oct 13, 2015 · 2 comments
Open

Can't compile example #15

chiangy77 opened this issue Oct 13, 2015 · 2 comments

Comments

@chiangy77
Copy link

Using Arduino 1.6.0 and it won't compile. Error log below:
Arduino: 1.6.0 (Windows 7), Board: "Arduino Uno"

Build options changed, rebuilding all

C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:30:1: error: 'prog_char' does not name a type
prog_char stringVar[] PROGMEM = "{0}";
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:31:1: error: 'prog_char' does not name a type
prog_char clientHandshakeLine1[] PROGMEM = "GET {0} HTTP/1.1";
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:32:1: error: 'prog_char' does not name a type
prog_char clientHandshakeLine2[] PROGMEM = "Upgrade: WebSocket";
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:33:1: error: 'prog_char' does not name a type
prog_char clientHandshakeLine3[] PROGMEM = "Connection: Upgrade";
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:34:1: error: 'prog_char' does not name a type
prog_char clientHandshakeLine4[] PROGMEM = "Host: {0}";
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:35:1: error: 'prog_char' does not name a type
prog_char clientHandshakeLine5[] PROGMEM = "Origin: ArduinoWebSocketClient";
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:36:1: error: 'prog_char' does not name a type
prog_char serverHandshake[] PROGMEM = "HTTP/1.1 101";
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:38:48: error: variable 'WebSocketClientStringTable' must be const in order to be put into read-only section by means of 'attribute((progmem))'
PROGMEM const char *WebSocketClientStringTable[] =
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:40:5: error: 'stringVar' was not declared in this scope
stringVar,
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:41:5: error: 'clientHandshakeLine1' was not declared in this scope
clientHandshakeLine1,
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:42:5: error: 'clientHandshakeLine2' was not declared in this scope
clientHandshakeLine2,
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:43:5: error: 'clientHandshakeLine3' was not declared in this scope
clientHandshakeLine3,
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:44:5: error: 'clientHandshakeLine4' was not declared in this scope
clientHandshakeLine4,
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:45:5: error: 'clientHandshakeLine5' was not declared in this scope
clientHandshakeLine5,
^
C:\Users\Matt\Documents\Arduino\libraries\ArduinoWebsocketClient-master\WebSocketClient.cpp:46:5: error: 'serverHandshake' was not declared in this scope
serverHandshake
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

@rclai
Copy link

rclai commented Oct 15, 2015

Same here. I followed these guidelines to get rid of most of the errors but the only line of code I can't seem to get the error to go away is this one.

@avenantsoftware
Copy link

that line needs to be changed to PROGMEM const char* const WebSocketClientStringTable[] =

this is how it should be changed:

const char stringVar[] PROGMEM = "{0}";
const char clientHandshakeLine1[] PROGMEM = "GET {0} HTTP/1.1";
const char clientHandshakeLine2[] PROGMEM = "Upgrade: WebSocket";
const char clientHandshakeLine3[] PROGMEM = "Connection: Upgrade";
const char clientHandshakeLine4[] PROGMEM = "Host: {0}";
const char clientHandshakeLine5[] PROGMEM = "Origin: ArduinoWebSocketClient";
const char serverHandshake[] PROGMEM = "HTTP/1.1 101";

PROGMEM const char* const WebSocketClientStringTable[] =
{
stringVar,
clientHandshakeLine1,
clientHandshakeLine2,
clientHandshakeLine3,
clientHandshakeLine4,
clientHandshakeLine5,
serverHandshake
};

then it compiles fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants