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 'MicroDebug' was not declared in this scope - when compiling in debug (Read 4905 times)
Vincent D
Newbies
*
Offline


Posts: 2
Joined: Jun 4th, 2015
'MicroDebug' was not declared in this scope - when compiling in debug
Jun 4th, 2015 at 4:48am
Print Post  
Hi, I'm trying to figure out what I'm doing wrong.  

Trying to compile for debug my Mega 2560 code that works fine in release mode.

Looks like a problem during the injected compile? :

Code
Select All
MegaTelemetrie.ino:In function 'void setup()'
MegaTelemetrie.ino:133:28: error: 'MicroDebug' was not declared in this scope 



I tried to to search the forums, but didn't find a relevant post.

for reference, the beggining of my setup function :

Code (C++)
Select All
void setup() {      

	pinMode(PIN_SW_GAUCHE, INPUT_PULLUP);
	pinMode(PIN_SW_DROITE, INPUT_PULLUP);
	pinMode(PIN_SW_BAS, INPUT_PULLUP);
	pinMode(PIN_SW_HAUT, INPUT_PULLUP);

	pinMode(PIN_LCD_BL, OUTPUT);//LCD backlight PWM control

...
 



Any idea ?

Thanks !
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: 'MicroDebug' was not declared in this scope - when compiling in debug
Reply #1 - Jun 4th, 2015 at 12:01pm
Print Post  
Hi,

Please switch on "tools>options>visual micro>compiler>show build folder"

Then build and you will see a link to the build folder in the output

CTRL+Click the link and email the MegaTelemetrie.cpp to info [at] visualmicro.com

Thanks
  
Back to top
IP Logged
 
Vincent D
Newbies
*
Offline


Posts: 2
Joined: Jun 4th, 2015
Re: 'MicroDebug' was not declared in this scope - when compiling in debug
Reply #2 - Jun 5th, 2015 at 4:56am
Print Post  
Thanks for your lead, I took a look at the INO cpp and it looks like the VM_DBG.h was injected under a custom ifdef that was not defined at this moment.  Here's how it looks :

#ifdef DEBUG_MEMORY
#include "arduino.h"
#include <VM_DBG.h>

DEBUG_MEMORY is a custom define I use sometime in the project to do memory optimization/debbuging and it's not currently enabled, so it explains the "not declared in this scope"...

I refactored my code to avoid this situation and debbuging works now.

Thanks again !
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: 'MicroDebug' was not declared in this scope - when compiling in debug
Reply #3 - Jun 5th, 2015 at 3:49pm
Print Post  
Oh that's an interesting one for me to remember.

Yes the first line of "valid" code is taken as the insertion point for arduino.h and the debugger etc.

For other users, please try to ensure there is not a conditional #if defined type expression immediately prior to the first line of code in the main sketch ino. I suspect the arduino ide does the same and will check that when time allows.

Thanks for the report Vincent
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint