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) Unexpected compiler declaration errors (Read 6595 times)
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Unexpected compiler declaration errors
Oct 6th, 2016 at 12:55pm
Print Post  
Release 1609.04 Sp2
Suddenly compiler begins to issue errors on my functions like:
error: 'Report' was not declared in this scope,
error: 'ISR' was not declared in this scope, etc.


if I made standard declaration like: void Report(void);
everything compiled and executing OK.
BUT in debug configuration I got: 
error: 'MicroDebug' was not declared in this scope

What reason can cause it?
« Last Edit: Oct 6th, 2016 at 12:59pm by Kabron »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unexpected compiler declaration errors
Reply #1 - Oct 6th, 2016 at 1:08pm
Print Post  
Hi,

Thanks for the report. I need some clarification.

1) Please ensure debug if off and then confirm what problems exist?

2) Confirm that you do not have a project_name.cpp in the sketch/project folder

Thanks
  
Back to top
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Unexpected compiler declaration errors
Reply #2 - Oct 6th, 2016 at 1:28pm
Print Post  
Well,
if Debug is Off and my functions declared - No problem.
if Debug is On and my functions declared - error: 'MicroDebug'
if Debug is On and my functions NOT declared - error: 'MicroDebug' and errors on all my functions.

Maybe it began after I upgraded Blynk libs to Blynk_Release_v0.3.10 instead of 038

PS. After returning to Blynk038 problem remains.
« Last Edit: Oct 6th, 2016 at 1:36pm by Kabron »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unexpected compiler declaration errors
Reply #3 - Oct 6th, 2016 at 1:36pm
Print Post  
Okay. 

In earlier releases of Visual Micro there was a lot of extra debug errors when a valid error was hit. That made it difficult to see what is happening.

If you update visual micro to the latest release the compiler errors might be easier to understand.

+

It's also always a good idea to switch on vMicro>compiler>verbose then click rebuild so we get a full compiler output. Save the output as a .txt and attach to a post here or email to info[at]visualmicro.com (include a link to this post)
  
Back to top
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Unexpected compiler declaration errors
Reply #4 - Oct 6th, 2016 at 1:57pm
Print Post  
I'm afraid to update.
Attached zipped verbose output
« Last Edit: Oct 6th, 2016 at 1:57pm by Kabron »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Unexpected compiler declaration errors
Reply #5 - Oct 6th, 2016 at 2:16pm
Print Post  
Update to 1610.4.2 did not solve the problem.
  
Back to top
 
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Unexpected compiler declaration errors
Reply #6 - Oct 6th, 2016 at 2:46pm
Print Post  
Solved but strange:


#define NodeMCU
//#define ESP01
//#define Witty

//====These defines produce NO ERROR 

//#ifdef NodeMCU 
//const int BUTTON      = 4;
//const int BLUE            = 16;
//#else
//const int BUTTON      = 4;
//const int RED            = 15;
//const int GREEN            = 12;
//const int BLUE            = 13;
//#endif


//====These defines produce ERROR 

#ifdef Witty 
const int LDR            = A0;
const int BUTTON      = 4;
const int RED            = 15;
const int GREEN            = 12;
const int BLUE            = 13;
#else
const int BUTTON      = 4;
const int BLUE            = 16;
#endif

void setup()
{
  /* add setup code here */
}

void loop()
{
  /* add main program code here */
}
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unexpected compiler declaration errors
Reply #7 - Oct 6th, 2016 at 3:13pm
Print Post  
Thanks for the update.

I think that if you had looked in the temp build folder at the project_name.cpp you would find that Visual Micro had inserted the debug header (VMDBG.H) just before the first line of code.

If the first line of code is in an #if, then the header would incorrectly be inserted inside the #if

There is some planned work to make a better insert point but adding a real line of code above all other code would also fix it.

Code (C++)
Select All

//a clean first line of code
//
int dummy;

//a clean first line of code
#define NodeMCU

//#define ESP01
//#define Witty

//====These defines produce NO ERROR

#ifdef Witty

//NOT a clean first line of code

const int LDR            = A0;
const int BUTTON      = 4;
const int RED            = 15;
const int GREEN            = 12;
const int BLUE            = 13;
#else
const int BUTTON      = 4;
const int BLUE            = 16;
#endif

void setup()
{
  /* add setup code here */
}

void loop()
{
  /* add main program code here */
} 


« Last Edit: Oct 6th, 2016 at 3:16pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Unexpected compiler declaration errors
Reply #8 - Oct 6th, 2016 at 3:19pm
Print Post  
Tim@Visual Micro wrote on Oct 6th, 2016 at 3:13pm:
Thanks for the update.

I think that if you had looked in the temp build folder


Thanks!
I'd like if you direct where this folder located.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Unexpected compiler declaration errors
Reply #9 - Oct 6th, 2016 at 3:53pm
Print Post  
Hi,

Switch on "vMicro>Compiler>Show Build Folder". A link will appear in the output of each build. 

Then you can CTRL+Click to view the folder (or open in windows explorer)
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint