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) 'MicroDebug' was not declared in this scope (Read 17756 times)
Enddoc
Junior Member
**
Offline


Posts: 12
Location: Miami, Florida
Joined: Aug 14th, 2012
'MicroDebug' was not declared in this scope
Aug 23rd, 2012 at 9:31pm
Print Post  
I set up the VS as described in the video which was quite good. I'm building that sketch.

Release the output window I get:
Compiling 'MySketch' for 'Arduino Duemilanove w/ ATmega328'
Binary sketch size: 1094 bytes (of a 30720 byte maximum) (1.383 secs)
Uploading to I/O board using 'COM5'
Done uploading

But when I do debug I get:
Compiling 'MySketch' for 'Arduino Duemilanove w/ ATmega328'
Binary sketch size: 1094 bytes (of a 30720 byte maximum) (1.69 secs)
Compiling debug version of 'MySketch' for 'Arduino Duemilanove w/ ATmega328'
MySketch.pde : In function 'void setup()'
MySketch.pde : 'MicroDebug' was not declared in this scope
MySketch.pde : In function 'void loop()'
MySketch.pde : 'MicroDebug' was not declared in this scope
Error compiling
Any ideas? I uninstalled the previous version and now I am using 1.1219 BETA.
Thank you.
  
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
Reply #1 - Aug 23rd, 2012 at 9:44pm
Print Post  
Hi,

1)

Have you set your Tools>Visual Micro>Compiler>Libary Optimization to false? 

If not, does that fix it?

2)

If the answer to 1) is no, then we need to check the uninstall remove the old files correctly. 

Please tell me the dates and times of the Visual.Micro.Processing.Sketch.dll and the Visual.Micro.Visual.Studio.Arduino.10.dll in the visual micro program folder.

If the dates and times are both before the 19th of aug then you should uninstall visual micro from control panel (add/remove programs) and then delete any remaining files (folders are okay and can remain) from the visual micro program folder and then install 1209.19 again.

Look forward to hearing the results

Thanks
  
Back to top
IP Logged
 
Enddoc
Junior Member
**
Offline


Posts: 12
Location: Miami, Florida
Joined: Aug 14th, 2012
Re: 'MicroDebug' was not declared in this scope
Reply #2 - Aug 24th, 2012 at 11:24am
Print Post  
1)

Have you set your Tools>Visual Micro>Compiler>Libary Optimization to false? 

If not, does that fix it?
Answer=No.

2)

If the answer to 1) is no, then we need to check the uninstall remove the old files correctly. 
Question: Do you mean the last beta or files of the sketch?

Please tell me the dates and times of the Visual.Micro.Processing.Sketch.dll and the Visual.Micro.Visual.Studio.Arduino.10.dll in the visual micro program folder.
Answer:
Visual.Micro.Processing.Sketch.dll = 7/19/2012
Visual.Micro.Visual.Studio.Arduino.10.dll = 7/19/2012

I'm now uninstalling and ensure the dll's are correct...thank once 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
Reply #3 - Aug 24th, 2012 at 11:28am
Print Post  
Okay you still have the july release installed which will certainly produce the eror you have encountered.

Please use windows control panel add/remove programs to uninstall vm, then run the install from codeplex.

The dll dates should all be august (not july as shown by your last message)

or maybe you are installing the wrong version? The beta notes explain that 1208.19 is not the default codeplex download. Click the "Downloads" tab at the top of codeplex to see the download for 1208.19
Thanks
« Last Edit: Aug 24th, 2012 at 11:56am by Tim@Visual Micro »  
Back to top
IP Logged
 
Enddoc
Junior Member
**
Offline


Posts: 12
Location: Miami, Florida
Joined: Aug 14th, 2012
Re: 'MicroDebug' was not declared in this scope
Reply #4 - Aug 24th, 2012 at 11:51am
Print Post  
Sorry, I must be dense. I see the reference but only 1208 and 1207 have an active download link not 1209.19. If it's not there can you reply with the 1209.19 link?
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
Reply #5 - Aug 24th, 2012 at 11:59am
Print Post  
No that was my fast typing, I mentioned 1208.19 and then went on to say 1209.19 just to confuse you Smiley

Note: The vm version numbers are the date the version was produced.

So your dlls were July 19 (07.19) and the current codeplex version for debug is Aug 19 2012 (1208.19)

I've altered the message below. Hope you can now see your dlls were from the build 1 month ago and that 1208.19 is the build you want. It will give dlls dated August of this year
  
Back to top
IP Logged
 
Enddoc
Junior Member
**
Offline


Posts: 12
Location: Miami, Florida
Joined: Aug 14th, 2012
Re: 'MicroDebug' was not declared in this scope
Reply #6 - Aug 24th, 2012 at 2:09pm
Print Post  
Okay, all is correct - no errors on compile.
Library = false
No breakpoints as per video work and standard breakpoints do not stop execution.
I'm using UNO on com4.
What's fix to check?
Thanks.
« Last Edit: Aug 24th, 2012 at 2:10pm by Enddoc »  
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
Reply #7 - Aug 24th, 2012 at 2:16pm
Print Post  
Breakpoints do not stop execution unless you switch on the debug break/pause project property. By default they are all trace points. This is a failsafe to prevent the arduino from stopping for new users that have not considered the effect of a stopage

What do you mean by standard breakpoints? There aren't any.

What do you mean "No breakpoints as per the video"?

Feel free to email your sketch folder, solution and its sub folders to info [at] visualmicro.com so I can see what properties and breakpoints you have set.
« Last Edit: Aug 24th, 2012 at 2:32pm by Tim@Visual Micro »  
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
Reply #8 - Aug 24th, 2012 at 11:29pm
Print Post  
Hi Enddoc,

Thanks for the great example, I think I can see the problem and here is also a bit of info to help. We certainly need better documentation Smiley

You have switched on "startup wait" and also set "startup delay" to 4 milliseconds. "Startup wait" causes the arduino to send a debug message to visual studio letting it know you want to wait for F5 to be pressed before the arduino will start.

The arduino starts up immediately after upload so in theory it sends the F5 wait message before Visual Studio has had a chance to start the debug listening.

So the reason why no trace messages appeared is because the startup delay is 4ms and visual micro missed the F5 message. The arduino is actually waiting so no trace messages appear. You will also find that pressing F5 in visual studio will ask you if you want to stop the debug session and re-compile. Again this is because visual studio doesn't know it is supposed to be waiting for you.

When things are working and you press F5 to continue Visual Micro uses a simple system to tell the arduino to continue. You can replicate the system simply by sending the 'c' serial character using the serial window. If you do this with your current setup you should see the debugger spring to life.

It's best to leave startup delay empty so vm uses defaults which I've tested quite well (i hope). I think the defaults are 500ms, I might be wrong. Anyway, a few seconds  (3000) wouldn't hurt Smiley

Actually if you are using the main upload port for debug and you have the "Startup Pause/Dtr" true (which is the default) then vm should be re-booting the arduino when it starts the debugger. 

Unrelated but a good thing to do.. Switch on the DTR checkbox on the serial monitor for COM4

I notice you have entered the default upload port as the LocalDebugPort. That's okay but you can leave it empty because vm defaults to the upload port (which I can see is selected on your std vm tool bar). I suggest you clear the LocalPort property for now.

All other settings look great. I think if you clear the localPort and set the startup delay property back to 0 it should be ok. I have my fingers and toes crossed Smiley



  
Back to top
IP Logged
 
SY-Adriana
Newbies
*
Offline


Posts: 1
Location: Rjukan, Norway
Joined: Aug 21st, 2012
Re: 'MicroDebug' was not declared in this scope
Reply #9 - Aug 28th, 2012 at 12:31pm
Print Post  
Thanks ! This solved the problem for me as well ! Works like a dream !
  
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
Reply #10 - Aug 28th, 2012 at 1:08pm
Print Post  
Thanks for the update, it always is a big help to hear the results Smiley

If I have mistakenly included an image in the help that shows the wait time as 4 milliseconds then please let me know so that I can re-make the screen shot. 

The value should be 0 (default) for new debug users.
« Last Edit: Aug 28th, 2012 at 1:11pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: 'MicroDebug' was not declared in this scope
Reply #11 - Jul 9th, 2016 at 5:09am
Print Post  
Tim, here is a simple example of the problem Enddoc describe and that I too am facing. I want to be able to define which classes I include in the compile. Say I have two different compass chips or motor drivers. I don't want both to be included in the output so I create an options file that specifies defines for the options I want to use. 

In the attached code, in the Options.h file, if you set Alpha to true and Beta to false it works fine. But if you set Alpha to false and Beta to true it generates:

IfDefTest.ino:In function 'void setup()
IfDefTest.ino:15:16: error: 'MicroDebug' was not declared in this scope
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging (pls let us know!)
Error compiling .ino source

  

Please Register or Login to the Forum to see File Attachments
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
Reply #12 - Jul 9th, 2016 at 3:34pm
Print Post  
Hi Bob,

The debug header is currently being inserted before the first line of code which is in an #if

There will be a fix in the next release but in the meantime add the following code to the top of the .ino file or move any global var to the top.

Code (C++)
Select All
int dummy; 



This will then be the first valid code line and well away from the conditional #if's
« Last Edit: Jul 9th, 2016 at 3:35pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint