Go Down

Topic: Tinywebserver compile problem (Read 2320 times) previous topic - next topic

Mikee

HI,
I'm trying to compile Simplewebserver example in IDE 1.0.3 from Tinywebserver library, I'm still getting error:

Code: [Select]
SimpleWebServer.ino: In function 'boolean index_handler(TinyWebServer&)':
SimpleWebServer:38: error: no match for 'operator<<' in 'web_server << (const __FlashStringHelper*)({...})'
SimpleWebServer.ino: In function 'void setup()':
SimpleWebServer:54: error: no match for 'operator<<' in 'Serial << (const __FlashStringHelper*)({...})'
SimpleWebServer:72: error: no match for 'operator<<' in 'Serial << (const __FlashStringHelper*)({...})'
SimpleWebServer:76: error: no match for 'operator<<' in 'Serial << (const __FlashStringHelper*)({...})'
SimpleWebServer:79: error: no match for 'operator<<' in 'Serial << (const __FlashStringHelper*)({...})'


What am I doing wrong? Thanks.

johnwasser

Apparently the construct:
Code: [Select]
Serial << F("string constant");

is no longer supported.  Try changing them to:

Code: [Select]
Serial.print(F("string constant"));
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Mikee

Hallo John,
I just  changed it and TinyWebserver in this first line is gray:
Code: [Select]
TinyWebServer[/font]::PathHandler handlers[] = {
  {"/", TinyWebServer::GET, &index_handler },
  {NULL},
};

and there is another error:
Code: [Select]
SimpleWebServer.ino: In function 'boolean index_handler(TinyWebServer&)':
SimpleWebServer:38: error: no match for call to '(TinyWebServer) (const __FlashStringHelper*)'
SimpleWebServer.ino: In function 'void setup()':
SimpleWebServer:54: error: no match for call to '(HardwareSerial) (const __FlashStringHelper*)'
SimpleWebServer:72: error: no match for call to '(HardwareSerial) (const __FlashStringHelper*)'
SimpleWebServer:76: error: no match for call to '(HardwareSerial) (const __FlashStringHelper*)'
SimpleWebServer:79: error: no match for call to '(HardwareSerial) (const __FlashStringHelper*)'

johnwasser

Looks like you may have forgotten to add ".print".
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

magnus_w

Hi !

I tried to compile the example "Blinkled" in   TinyWebServer_master\examples, in Arduino 1.0.3, and
after fixing the .print I got this :

C:\...\arduino-1.0.3\libraries\TinyWebServer_master\TinyWebServer.cpp:43: error: expected constructor, destructor, or type conversion before '(' token

Of course this error has a lots of friends, but this is the first.



the part of  "TinyWebServer.cpp" looks like this:h
( Flash_string in on line 43 )

FLASH_STRING(mime_types,
  "HTM*text/html|"
  "TXT*text/plain|"
  "CSS*text/css|"
  "XML*text/xml|"
  "JS*text/javascript|"
  "GIF*image/gif|"
  "JPG*image/jpeg|"
  "PNG*image/png|"
  "ICO*image/vnd.microsoft.icon|"
  "MP3*audio/mpeg|"
);

//Magnus




johnwasser

Looks like the "FLASH_STRING" macro is not defined in your code.  You may have to find the original definition and include it in your library.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Supermat

Hello,

I have the problem today and i find an issue so ....

For
Code: [Select]
Serial << F("string constant");
You need to add this librarie : http://arduiniana.org/libraries/streaming/

For TinyWebServer.cpp:43: error: expected constructor, destructor, or type conversion before '(' token
that come from :
Code: [Select]
FLASH_STRING(mime_types,
 "HTM*text/html|"
 "TXT*text/plain|"
 "CSS*text/css|"
 "XML*text/xml|"
 "JS*text/javascript|"
 "GIF*image/gif|"
 "JPG*image/jpeg|"
 "PNG*image/png|"
 "ICO*image/vnd.microsoft.icon|"
 "MP3*audio/mpeg|"
);

You need to add this librarie : http://arduiniana.org/libraries/flash/

Go Up