Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic VS does not compile Azure example; but standard Arduino does compile. (Read 1897 times)
Nikolaj
Newbies
*
Offline


Posts: 3
Joined: Jan 21st, 2023
VS does not compile Azure example; but standard Arduino does compile.
Apr 23rd, 2023 at 1:51pm
Print Post  
Hi,

I am trying out this example from Microsoft, and it compiles just fine on the latest Arduino IDE. However, it does not compile using Visual Micro, and I wonder why not. I suspect a compiler setting or something like that, but I have no clue of which. 

I have cleared all libraries, and only installed these:
ArduinoJSON
ArduinoOTA
Azure_SDK_for_C
AzureIoTHubMQTTClient
EspMQTTClient (Patrick Lapointe)
PubSubClient (Nick O'Leary)
Time (Michael Margolis)

Board is a "LOLIN(Wemos) D1 R2 & Mini" (an ESP8266).

Can someone maybe please help?

br, Nikolaj
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS does not compile Azure example; but standard Arduino does compile.
Reply #1 - Apr 23rd, 2023 at 2:29pm
Print Post  
Thanks for the info. The error shows missing library dependancy but I suspect that there are two libraries with some similar #includes. 

When it is not clear which libraray to use there is best guess and we probably need to look again at what arduino does these days. for example

lib1/ArduinoOTA.h
lib2/ArduinoOTA.h

where there is an #include <ArduinoOTA.h> in the code.

That example isn't entirely right but gives the gist of the issue.

In short, the error you see is that the ArduinoOTA.h can't be resolved and it is needed by the EspMQTTClient that you are using.

Try adding the #include below the #include <EspMQTTClient.h> in the .ino

Add this line to your ino code ...

#include <ArduinoOTA.h>

That is a short answer that might or might not work. 

If you can post or email your .ino code so that we can see your #includes that will allow us to fix the issue. 

  
Back to top
IP Logged
 
Nikolaj
Newbies
*
Offline


Posts: 3
Joined: Jan 21st, 2023
Re: VS does not compile Azure example; but standard Arduino does compile.
Reply #2 - Apr 23rd, 2023 at 3:07pm
Print Post  
Hi,
That was a quick response Smiley
I forgot to mention which file I'm compiling. It's this Microsoft example: https://github.com/Azure/azure-sdk-for-c-arduino/blob/main/examples/Azure_IoT_Hu...
Taken from here: https://github.com/Azure/azure-sdk-for-c-arduino/tree/main/examples/Azure_IoT_Hu...

I tried what you suggested. It did not work (same type of error), so I also included other libraries it complained about:
#include <ArduinoJSON.h>
#include <ArduinoOTA.h>
#include <TimeLib.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPUpdateServer.h>

I noticed that it's compiling towards a debug ARM, which I changed to Release X64. 

And then I cleaned the build before recompiling. But still getting errors...
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS does not compile Azure example; but standard Arduino does compile.
Reply #3 - Apr 23rd, 2023 at 3:15pm
Print Post  
Great we will take a look. 

btw: The Configuration names on the tool bar are not related to an arduino build, they manly affect intellisense. However the word "debug" appearing in a configuration name can cause the automatic debugger to be enabled.
  
Back to top
IP Logged
 
Nikolaj
Newbies
*
Offline


Posts: 3
Joined: Jan 21st, 2023
Re: VS does not compile Azure example; but standard Arduino does compile.
Reply #4 - May 7th, 2023 at 5:50am
Print Post  
Great, thanks! Any idea as to when a fix is ready?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS does not compile Azure example; but standard Arduino does compile.
Reply #5 - May 7th, 2023 at 10:37pm
Print Post  
We tried the Microsoft example and it compiled okay for us.

Looking at your build output it seems to have discovered other libraries with similar .h names. Not the the one srecommended by microsoft.

If the same code works in the arduino ide then this suggests a different configuration in visual micro than arduino ide. Can you please switch on file>preferences>verbose in th arduino ide. Then build and post the output as txt file. 

Thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint