Compile Errors on Dev Branch (split of Webserver.h into .cpp)
Closed this issue · 2 comments
Getting some pretty bad compile errors when trying the new code from @cyberwaelder in Arduino 22:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:25: error: 'WebServer' has not been declared
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:25: error: ISO C++ forbids declaration of 'WebServer' with no type
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'int WebServer(const char_, int)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:25: error: only constructors take base initializers
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:32: error: 'defaultFailCmd' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:37: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'void begin()':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:39: error: 'm_server' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:42: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:42: error: variable or field 'setDefaultCommand' declared void
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:42: error: 'Command' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:42: error: 'cmd' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:47: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:47: error: variable or field 'setFailureCommand' declared void
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:47: error: 'Command' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:47: error: 'cmd' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:52: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:52: error: 'Command' has not been declared
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'void addCommand(const char_, int_)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:54: error: 'm_cmdCount' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:54: error: 'm_commands' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:54: error: 'SIZE' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:61: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:61: error: variable or field 'write' declared void
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:61: error: 'uint8_t' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:66: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'void write(const char_)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:68: error: 'm_client' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:71: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:71: error: expected ',' or '...' before '' token
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:71: error: ISO C++ forbids declaration of 'uint8_t' with no type
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'void write(int)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:73: error: 'm_client' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:73: error: 'buffer' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:73: error: 'size' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:76: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:76: error: 'size_t' has not been declared
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'void write(const char, int)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:78: error: 'm_client' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:78: error: ISO C++ forbids declaration of 'type name' with no type
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:78: error: ISO C++ forbids declaration of 'type name' with no type
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:78: error: expected primary-expression before 'const'
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:78: error: expected )' before 'const' /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope: /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:81: error: 'WebServer' is not a class or namespace /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:81: error: expected ',' or '...' before '*' token /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:81: error: ISO C++ forbids declaration of 'prog_uchar' with no type /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'void writeP(int)': /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:85: error: 'uint8_t' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:85: error: expected
;' before 'buffer'
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:86: error: 'size_t' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:86: error: expected ;' before 'bufferEnd' /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:88: error: 'length' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:90: error: 'bufferEnd' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:92: error: 'm_client' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:92: error: 'buffer' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:96: error: 'buffer' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:96: error: 'bufferEnd' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:96: error: 'data' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:96: error: 'pgm_read_byte' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:99: error: 'bufferEnd' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:100: error: 'm_client' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:100: error: 'buffer' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope: /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:103: error: 'WebServer' is not a class or namespace /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:103: error: expected ',' or '...' before '*' token /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:103: error: ISO C++ forbids declaration of 'prog_uchar' with no type /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'void printP(int)': /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:107: error: 'uint8_t' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:107: error: expected
;' before 'buffer'
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:108: error: 'size_t' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:108: error: expected ;' before 'bufferEnd' /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:110: error: 'buffer' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:110: error: 'bufferEnd' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:110: error: 'str' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:110: error: 'pgm_read_byte' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:114: error: 'm_client' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:120: error: 'bufferEnd' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:121: error: 'm_client' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:121: error: 'buffer' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope: /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:124: error: 'WebServer' is not a class or namespace /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: In function 'void printCRLF()': /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:126: error: 'm_client' was not declared in this scope /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:126: error: ISO C++ forbids declaration of 'type name' with no type /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:126: error: ISO C++ forbids declaration of 'type name' with no type /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:126: error: expected primary-expression before 'const' /Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:126: error: expected
)' before 'const'
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp: At global scope:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:129: error: 'WebServer' is not a class or namespace
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:129: error: 'ConnectionType' was not declared in this scope
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:129: error: expected primary-expression before 'char'
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:130: error: expected primary-expression before 'bool'
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:130: error: initializer expression list treated as compound expression
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.cpp:131: error: expected ',' or ';' before '{' token
How did you fix this?
#include <Client.h> and #include <Server.h> were missing.