Pages: [1]   Go Down
Author Topic: Tinywebserver compile problem  (Read 2102 times)
0 Members and 1 Guest are viewing this topic.
Slovakia
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Code:
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.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

is no longer supported.  Try changing them to:

Code:
Serial.print(F("string constant"));
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Slovakia
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hallo John,
I just  changed it and TinyWebserver in this first line is gray:
Code:
TinyWebServer[/font]::PathHandler handlers[] = {
  {"/", TinyWebServer::GET, &index_handler },
  {NULL},
};
and there is another error:
Code:
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*)'
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like you may have forgotten to add ".print".
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Sweden
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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



Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

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

For
Code:
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:
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/
Logged

Pages: [1]   Go Up
Jump to: