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
Hot Topic (More than 8 Replies) Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine (Read 1978 times)
RicardoDV
Newbies
*
Offline


Posts: 8
Joined: May 2nd, 2020
Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Dec 12th, 2020 at 7:40pm
Print Post  
Hi, I have followed the instructions and attached the output from visual micro and the output from the Arduino IDE along with my full code.  Any pointers will be appreciated. This had been working fine using visual micro.     I have a 3 computer perpetual license installed.  Thanks,
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
RicardoDV
Newbies
*
Offline


Posts: 8
Joined: May 2nd, 2020
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #1 - Dec 12th, 2020 at 7:40pm
Print Post  
Here is the complete code.
  

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #2 - Dec 14th, 2020 at 11:02am
Print Post  
Thanks for the report and detail.

Can you try updating to the latest forum release of Visual Micro (20.09.10.22) from the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

If this still fails with the same code, can you confirm which specific libraries are in use for this project (URLs or Full Library Name in Board Manager)
  
Back to top
 
IP Logged
 
RicardoDV
Newbies
*
Offline


Posts: 8
Joined: May 2nd, 2020
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #3 - Dec 16th, 2020 at 12:00pm
Print Post  
Hi, thanks for the reply.  I just installed the newest forum release and the result is the same, it doesn't compile.  Attached are the libraries I use and the Arduino core board is ESP8266 v 2.7.0
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #4 - Dec 16th, 2020 at 2:21pm
Print Post  
Sorry, I cannot see an attachment, or has it been sent via email?
  
Back to top
 
IP Logged
 
RicardoDV
Newbies
*
Offline


Posts: 8
Joined: May 2nd, 2020
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #5 - Dec 17th, 2020 at 12:45am
Print Post  
Yes email, sorry.
  
Back to top
 
IP Logged
 
RicardoDV
Newbies
*
Offline


Posts: 8
Joined: May 2nd, 2020
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #6 - Dec 27th, 2020 at 2:06pm
Print Post  
I got this working, but I don't fully understand what is happening.    The first thing I did, was to eliminate passing arguments of a custom struct type I declared to any function ("contactorStationInformation"), I used global variables instead.   In the Arduino IDE, I don't have to do this, it compiles just fine.   Then I got a different error, saying the functions were not declared in this scope.  The only workaround I came up with, is to declare them manually at the beginning of my program.  It compiles just fine now.  I can work with this but is weird that the Arduino IDE can compile without these changes.   

I started new projects on different computers to see if I had the same issues, and I sure did.  Same results, the Arduino IDE can compile the original code, the VS2019 with visual micro needed these changes.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #7 - Dec 28th, 2020 at 5:41pm
Print Post  
When .ino code is compiled, we have to extract methods from the .ino code and turn them into prototypes that are then inserted into the temp copy of the .ino code prior to build. 

The insertion point for the prototypes sounds like it is wrong. It is the most complex area of the build process but usually works well.

We will look at the output you have sent to see what is throwing it out. It is often easier to track these things when debugging is OFF, that also gives direct comparison with the Arduino IDE. If you have not already sent this file please do :-

C:\Users\ricar\AppData\Local\Temp\VMBuilds\Home Automation Base ESP8266\esp8266_nodemcuv2\Debug\Home Automation Base ESP8266.cpp
  
Back to top
WWW  
IP Logged
 
RicardoDV
Newbies
*
Offline


Posts: 8
Joined: May 2nd, 2020
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #8 - Dec 30th, 2020 at 1:59pm
Print Post  
Here is the file.  Thanks,
  

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


Posts: 2145
Joined: Feb 13th, 2019
Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Reply #9 - Feb 5th, 2021 at 11:33am
Print Post  
If you upgrade to the latest version of Visual Micro (from the below board):

And also add a dummy "InjectPrototypesHere()" function as below, just before all of your prototype functions:
Code
Select All
// .... your code...
ESP8266WebServer server(80);

void InjectPrototypesHere(){
}

void handleRoot();
// rest of your code...
 



Does this improve the compilation?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint