You are viewing a static version of the site. Enable JavaScript to benefit from the
full functionality of this site and enable such things as forum posting.
Compiler Error in Library HttpClient
claus1812:
When using
#include <HTTPClient.h>
in my scetches the compiler pulls automatically AzureIoT Library.
Compiling then fails with these errors:
"‣ AzureIoT [C:\Users\claus\AppData\Local\UECIDE\libraries\Communications\esp32\AzureIoT]
• Error at line 271 in file stdatomic.h:
‣ request for member '__val' in something not a structure or union
• Error at line 387 in file stdatomic.h:
‣ incompatible type for argument 1 of '__atomic_exchange_n'
• Error at line 285 in file stdatomic.h:
‣ request for member '__val' in something not a structure or union
• Error at line 394 in file stdatomic.h:
‣ incompatible type for argument 1 of '__atomic_store_n'
• Error at line 273 in file stdatomic.h:
‣ request for member '__val' in something not a structure or union
• Error at line 45 in file refcount.h:
‣ incompatible type for argument 1 of '__atomic_fetch_add'
• Error at line 279 in file stdatomic.h:
‣ request for member '__val' in something not a structure or union
• Error at line 45 in file refcount.h:
‣ incompatible type for argument 1 of '__atomic_fetch_sub'
Compiling Failed"
What can I do ?
matt:
What board are you compiling for?
matt:
I can't find any references to AzureIoT in any of the HttpClient libraries I can find. Are you sure it's coming from there? Maybe it's coming from something that the HttpClient library itself is including. I'd need to know exactly what HttpClient library it is - what version, what it's intended to work with, etc.
claus1812:
I'm compiling for ESP32 DEV Board. I'm only using standard libraries, which came with UECIDE Installation. See attached Exmaple.ino which is standard example for HttpClient library. Even this example creates same compiler errors. The example compiles in Arduino IDE without any errors.
matt:
Ok, I'll take a look at this. It's probably something like an old version of the compiler or something. Also UECIDE doesn't handle #ifdef
when probing for required libraries very well, so it's probably picking stuff up it shouldn't be picking up. That said, AzureIoT should compile...
matt:
Ok, I've found why it wants to compile AzureIoT. There's a system (i.e., "in the compiler" header file base64.h
which is used all over the place. That's no problem. What is a problem is that AzureIoT has a base64.h
header of its own. So whenever anything uses base64.h
UECIDE finds that file in AzureIoT and assumes you want that library.
Not sure what I can do about that, but a simple "fix" is to remove the AzureIoT library from your installation.
claus1812:
Thanks a lot for this workaround. Works like a charme now.
matt:
Cool.
I have a proper fix, which also should give a massive improvement to the esp32 core in general. However deploying it is going to be a little delicate.
It involves switching to using the compiler to identify required headers, which means that it will start handling #ifdef
properly. However I can't just deploy that (which is a single line in a config file) as that relies on code in UECIDE which it turns out has a bug. In this instance it adds the WiFi library twice - once for WiFi.h and once for WiFiMulti.h. And that really confuses things.
So I need to first deploy a fix to UECIDE and wait a while for people to pick up the new version, then deploy the switchover to the improved library detection.
So I'm going to release the new version of UECIDE shortly and leave it a week to release the rest of the fix.
claus1812:
I've installed your latest update. Now I'm getting new compiler errors:
Compiling...
• Preprocessing...
• Converting binary files
java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042)
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:996)
at org.uecide.Sketch.compile(Sketch.java:2407)
at org.uecide.Sketch.build(Sketch.java:1822)
at org.uecide.Editor$DefaultRunHandler.run(Editor.java:203)
at java.base/java.lang.Thread.run(Thread.java:834)
• Compiling sketch...
• Error at line 5 in file Tankanzeige.ino:
‣ WiFi.h: No such file or directory
Compiling Failed
matt:
The compilation error is simply that it didn't know where to look for WiFi.h
. It didn't know where to look for WiFi.h
because of the ConcurrentModificationException
. The details never got stored in the list of libraries properly. This is a problem with Java that it doesn't like threads and arrays. It gets messy. So sometimes you get these exceptions.
They happen randomly and at different times, and they're a pain to track down.
You'll probably find that the problem has already gone away of its own accord.
If not you can switch to the new library probing early by finding the compilers/xtensa-exp32-elf/compiler.txt
file in the UECIDE data directory and adding the line:
compile.preproc=${gpp}::-M::-MG::${source.name}::${cppflags}::${includes}::${preproc.includes}::-MF::${object.name}
matt:
Another thing that can help avoid the problem is to temporarily disable the "Tree Updater" service in the Service Manager (Tools menu)