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) Scope Error (Read 3309 times)
Paul Di
Newbies
*
Offline


Posts: 5
Joined: Mar 19th, 2020
Scope Error
Mar 19th, 2020 at 8:53am
Print Post  
I have several projects using visual micro with VS2017.  All of a sudden I am getting scope errors.  It is not a missing closing } or something like that.  It is with all of my projects.  It is occurring with code that was saved and working perfectly.  I am using ESP8266 and I am using the following libraries, #include <Scheduler.h>
#include <Task.h>
#include <FS.h>
I have always had methods outside of the Tasks and there was never an issue.   
Please see the attached images.  I understand I can move the methods inside each task but two tasks use the same methods and I am hoping to not duplicate the functions in every task.  Any help or suggestions would be greatly appreciated.

Thank you.
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Scope Error
Reply #1 - Mar 19th, 2020 at 12:35pm
Print Post  
Try the latest update it has a minor fix. If you have continue issues please follow the guide in yellow above so that we can see the real compiler output.
« Last Edit: Mar 19th, 2020 at 12:36pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Scope Error
Reply #2 - Mar 19th, 2020 at 4:50pm
Print Post  
Thanks for the example sent via email, its an impressive arduino sketch.

Would it be possible to also send us your libraries folder (zipped) so we definitely have all the right code to replicate with?
  
Back to top
 
IP Logged
 
Paul Di
Newbies
*
Offline


Posts: 5
Joined: Mar 19th, 2020
Re: Scope Error
Reply #3 - Mar 19th, 2020 at 4:57pm
Print Post  
Hello,

Thank you for the reply.  Generate prototypes has always been set to true to my knowledge.  Everything has worked perfectly for a very long time.  Yesterday I went to compile and have not been able to successfully build since.  Sadly adding the board.txt to the project with vm.ctags=false does not help a successful compile.  I have attached the output log.   

The problem I am having only seems to be specifically when compiling for the board "Generic ESP8266"   I have some sketches for WEMOS D1 R1 that build ok.  They use similar functions that are not directly in the task and they do not get the out of scope error.

I only have build/compile issues with ESP8266 and ESP32.  Thank you for your time.
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Scope Error
Reply #4 - Mar 19th, 2020 at 5:49pm
Print Post  
Thanks for the info.

Please zip and email this folder and sub folders C:\Users\papas\Documents\Arduino\libraries
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Scope Error
Reply #5 - Mar 19th, 2020 at 5:53pm
Print Post  
Please zip and email this folder

C:/Users/papas/Documents/Arduino/Libraries
« Last Edit: Mar 19th, 2020 at 6:16pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Paul Di
Newbies
*
Offline


Posts: 5
Joined: Mar 19th, 2020
Re: Scope Error
Reply #6 - Mar 19th, 2020 at 6:14pm
Print Post  
Hello,

Folder is quite large and I am getting some permission errors trying to zip.  I am sending files with we transfer.  Hope that is okay,  It is slow but it will contain the exact libraries I am using.  You will get email once file upload is complete.  Thanks again.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Scope Error
Reply #7 - Mar 19th, 2020 at 6:18pm
Print Post  
Oooops!! I changed the path to the libraries folder. I don't need all your sketch book folders.

Yes you can also give urls for any libs you have downloaded or if they are in library manager their names and author name.
  
Back to top
WWW  
IP Logged
 
Paul Di
Newbies
*
Offline


Posts: 5
Joined: Mar 19th, 2020
Re: Scope Error
Reply #8 - Mar 19th, 2020 at 6:53pm
Print Post  
I understand.  The libraries folder is almost 200 mb.   It does not contain the sketehes.  Just the libraries.  

I am using esp8266 core v2.3.0

#include <KMPDinoWiFiESP.h>
#include <KMPCommon.h>
https://github.com/kmpelectronics/Arduino

#include <ArduinoJson.h>
ArduinoJson Version 5.13.1 by Benoit Blanchon

#include <Task.h>
#include <FS.h>
#include <Scheduler.h>
https://github.com/nrwiersma/ESP8266Scheduler

#include <PubSubClient.h>
PubSubClient v2.6.0 by Nick O'Leary

#include <ModbusMaster.h>
ModbusMaster V2.0.1 by Doc Walker

#include "ESPAsyncTCP.h"
https://github.com/me-no-dev/ESPAsyncTCP

#include <ESP8266httpUpdate.h>
https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266httpUpdate

#include <ESP8266Ping.h>
https://www.arduinolibraries.info/libraries/esp8266-ping

https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WiFi

I will try to provide more information that may be helpful later on.

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