VS Arduino
>> >> Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
https://www.visualmicro.com/forums/YaBB.pl?num=1607802015

Message started by RicardoDV on Dec 12th, 2020 at 7:40pm

Title: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by RicardoDV on Dec 12th, 2020 at 7:40pm
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,
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Output_-_visual_micro.txt ( 176 KB | 8 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Code_main.txt ( 30 KB | 4 Downloads )

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by RicardoDV on Dec 12th, 2020 at 7:40pm
Here is the complete code.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Code_main_001.txt ( 30 KB | 6 Downloads )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=BMP_functions.ino ( 2 KB | 6 Downloads )

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by Simon@Visual Micro on Dec 14th, 2020 at 11:02am
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)

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by RicardoDV on Dec 16th, 2020 at 12:00pm
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

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by Simon@Visual Micro on Dec 16th, 2020 at 2:21pm
Sorry, I cannot see an attachment, or has it been sent via email?

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by RicardoDV on Dec 17th, 2020 at 12:45am
Yes email, sorry.

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by RicardoDV on Dec 27th, 2020 at 2:06pm
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.

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by Visual Micro on Dec 28th, 2020 at 5:41pm
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

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by RicardoDV on Dec 30th, 2020 at 1:59pm
Here is the file.  Thanks,
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Home_Automation_Base_ESP8266.cpp ( 32 KB | 8 Downloads )

Title: Re: Unable to compile in visual micro, identical code and libraries in Arduino IDE compile and run fine
Post by Simon@Visual Micro on Feb 5th, 2021 at 11:33am
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]
// .... your code...
ESP8266WebServer server(80);

void InjectPrototypesHere(){
}

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

Does this improve the compilation?

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.