full functionality of this site and enable such things as forum posting.
Bug in Library (or compiler): ESPmDNS.h
searching the web for a faster way to compile my arduino sketches
for ESP32 than the slow Arduiono IDE compiler I came across this wonderful UECIDE. Installation was fast and installing the board ESP32-Dev as well.
Test sketch "Blink" compiles like a charm.
However when trying to compile my existing sketches
(which compile an run w/o errors in Arduino IDE)
I run into compiler errors in UECIDE and I have no idea why.
When including the library ESPmDNS.h in my sketches I get this compiler error:
• Error at line 0 in file <command-line>:
‣ 'esp32' was not declared in this scope
When including the library ESPAsyncWebServer.h (a more sophisticated Webserver than the standard one, which I successfully use in my projects), then I get this compiler error:
Error at line 34 in file md5.h:
‣ #include expects "FILENAME" or <FILENAME>
As I said, both includes work w/o any problems and errors in the Arduino IDE.
Any hints how I can make them work in UECIDE as well ?
I have just compiled examples from both those libraries perfectly fine.
md5.h is part of the core. Could it be that you are using old versions of the libraries that work with an old version of the Arduino core? I build the UECIDE packages from core version 1.0.4.
I did not build any UECIDE packages. I just downloaded and installed the latest full version from UECIDE website. Then I opened package manager and installed ESP32-Dev Board (which downloads and installs automatically all required libraries). The compiler error comes up instantly with any sketch including ESPmDNS.h which is part of the automatically downloaded libraries. So there is nothing I can do different.
The ESPAsyncWebServer library I've imported manually. It is the latest version from GitHub and it works perfectly without any compiler errors in the Arduino IDE.
Strange. I can't get it to fail. What OS are you using?
I've just tried the same thing on my MacBookPro and it compiles w/o any errors.
Very strange. I really would prefer to run it on my Windows 10 PC as this is my developing machine. What can I do ?
Maybe then it's to do with the windows version of the compiler. I'll spin up my VM and have a play.
Ok, I can certainly recreate this under Windows. Now to start digging...
Ok. The first problem - the "esp32" not defined. This is somewhat silly. It stems from the command line option:
In every OS except windows that is taken verbatim, so you end up with
"esp32" (including the quotes). But in Windows the quotes are being removed. So you end up with the literal
esp32 in the code instead of the string
"esp32". Which breaks.
Now fortunately there's a bit in the code that can handle this, so it's obviously something that has been seen before, but not when using the Arduino IDE, so it must be doing something special with command line arguments to the compiler. So I can just enable that code with another command line option to fix it, no problem.
The second problem is actually the same problem. It's including a file that is passed as a command line argument including quotes, and Windows is stripping the quotes. In this instance there is nothing to add the quotes, so it can never work in another IDE that doesn't do whatever black magic the Arduino IDE does (incidentally, the macro I set for the other fix is
__IN_ECLIPSE__, so I guess this code can never work in Eclipse, the single biggest IDE out there for professional use...). So I think the
real fix will be to find out why the quotes are disappearing.
Thanks for your investigations (which are far beyond my expertise). Once you can recommend an easy workaround to get rid of this compiler errors, please let me know.
BTW: I tried to use the normal WebServer.h instead of the ESPAsyncWebServer.h
However even then the md5 compiler error comes up.
The "easy fix" will be to upgrade UECIDE when I release the next version. I have found this:
https://bugs.openjdk.java.net/browse/JDK-8131908 which speaks about the very problem we are seeing. Basically it boils down to "Windows is a dick". It, unlike every other OS in the universe, actively deletes the quotes from the command line. Dick. Typical windows. "How does everyone else do it? Ok, we'll do the exact opposite".
Ok, I have it compiling in Windows now.
The "fix" is twofold:
Upgrade UECIDE to version 0.11.5
Upgrade the ESP32 plugins to version 1.2.5 (in the Plugin Manager)
Wow, that was a fast reaction !
Thank you so much.
Everything compiles fast and error free now.
I've just sent a donation for UECIDE.
Thanks very much :) I aim to please. As a non-windows user I rely on people like you to break things for me.
I've just turned off adverts on this site for you too (or I think I have...)