-->
Page 1 of 3

Help on rebuild

PostPosted: Thu Dec 08, 2016 4:40 pm
by Joaquim Boavida
Hi,
First of all my congratulations to MMISCOOL for the great work on ESP8266 Basic.

I need some help in rebuild the source code,. I only want to translate change some strings, to be on my language.
I'm not very good at C but I think I can manage.

So, after install the latest versio of Arduino (1.6.11) I had the ESP8266 boards installed using this tutorial:
https://learn.sparkfun.com/tutorials/es ... uino-addon

Then I downloaded the ESPbasic source code from the GitHub and replace the libraries of Arduino with the ones in the source code.
Choose "Generic ESP8266 module as board"
Open "ESP8266Basic.ino" and try to rebuild without any modification on the source code.
Got a lot of errors :?


Build options changed, rebuilding all
In file included from D:\Arduino\Basic_ESP8266\ESP8266Basic\ESP8266Basic.ino:767:0:
sketch\Classes.h: In member function 'void JUMPLIST::add(String, uint16_t)':
Classes.h:100: error: 'PrintAndWebOut' was not declared in this scope
PrintAndWebOut(String(_ERR4) + label); // label already defined
^

Classes.h:105: error: 'PrintAndWebOut' was not declared in this scope
PrintAndWebOut(String(_ERR7) + label); // too much labels
^

sketch\Classes.h: In member function 'void IFBLOCKLIST::setIf(uint16_t)':

Classes.h:222: error: 'PrintAndWebOut' was not declared in this scope

PrintAndWebOut(String(_ERR5) + String(stack[_ptr]._ifpos)); // too much if endif nested

and so on...

What I'm doing wrong?

Thanks for any help

Joaquim

Re: Help on rebuild

PostPosted: Thu Jan 26, 2017 4:31 am
by DJefferies
Did anyone find a solution to this issue? I have been having the same problem and updating to the latest compiler has not resolved the problem. PrintAndWebOut() is declared in Web_Gui_Stuff.ino and this is part of the zip, appearing in one of the tabs. I'm sure its something simple, maybe a setting but have not been able to figure it out.

Re: Help on rebuild

PostPosted: Thu Jan 26, 2017 1:46 pm
by Oldbod
Last time I built this I tried to move on from 1.6.5. Mmiscool has mentioned building with this version in the past. I couldn't get it to work. Had to go back to 1.6.5 then it worked. You do need to check you're using the libraries from the esp8266 basic download not the ones that install with the ide. I'm not sure what impact the versions of board related stuff has but I suspect at least some.

I get many deprecated warnings and there's something not right as the version I build takes nearly twice as long to run the same espbasic program as the download. Not a practical issue for me as I'm just fiddling, but it is VERY frustrating that I don't understand the impact of changes in the ide. The differences between versions must be documented somewhere (github?) but too deep for me.

Re: Help on rebuild

PostPosted: Fri Jan 27, 2017 7:00 pm
by DJefferies
I found the solution so I'll post the details in case others may find it helpful. The problem is with the compiler and results from the order in which the source files are compiled. If you call a function that is declared anywhere in the file you are working with, it will be able to verify the calls against the prototype. If the declaration exists in a different file, it may fail due to there being no prototype found in that file. I suspect it may work if the declaration existed in a previously compiled file or I suspect I would have had a lot more errors.

I ended up adding these declarations to the top of "Classes.h":

void PrintAndWebOut(String itemToBePrinted);
String evaluate(String expr);
void SetMeThatVar(String VariableNameToFind, String NewContents, int format);
String VarialbeLookup(String VariableNameToFind);

In addition, I had a problem with the SoftwareSerial functions but didn't require those functions so I cheated and commented them out. I'm pretty sure it was due to me having a similar library somewhere amongst my collection as suggested in Oldbod's post.

Thanks for the advice and I hope my experiences are helpful to others.