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) Program code aborts (Read 5640 times)
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Program code aborts
Mar 27th, 2018 at 4:54pm
Print Post  
I am having several compile and execute problems that started when I created a class library and ran into a problem finding WProgram.h. Changed that to include arduino.h, but compiler couldn't find that file either. References to Serial were being flagged but the code ran. I searched for WProgram.h and could not find the file on my hard drive. 

Then I created a simple program called LED (attached) which just turns LEDs on and off. It won't even run. It simply restarts every couple seconds. 

These two problems seem very related. The text that shows up at the end of the CompilerOutput.txt file talks about WiFi debugging which is not a part of this code base. This text doesn't usually appear, so I am wondering if there is a setting I am not configuring correctly.
It feels like my desktop has become very unstable. Please advise.
  

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


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program code aborts
Reply #1 - Mar 27th, 2018 at 5:43pm
Print Post  
Please switch the tool bar from Debug to Release and confirm if your projects build
  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Program code aborts
Reply #2 - Mar 27th, 2018 at 8:32pm
Print Post  
There seem to be two problems: 
(1) flakey hardware - replaced the Nano chip and the LED code now works fine.
(2) compiler problem - same for both release and debug

Details:
(1) #include "Arduino.h" fails but the failure which should halt the compile doesn't halt it or show up as a warning or error diagnostic except on screen (see images folder screen shot)
(2) Usage of Serial.print fail (see screen shot) with an on-screen message: "Identifier 'Serial' is undefined.

The sketch compiles and uploads with no errors or warnings but nothing gets printed on the Serial Monitor which I suspect means that the Serial object is missing.

I have produced a ZIP file with everything in it, but there is not obvious button that allows me to attach it to this reply. Please advize how to send you the details.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program code aborts
Reply #3 - Mar 27th, 2018 at 8:49pm
Print Post  
Hi

Can't see anything wrong with the project or code

Can't see any images folder

The compiler output shows good build and upload.

Visual Micro "program exited" during debug can simply mean the serial or usb has gone/closed.

You will find the arduino.h in the core. Use vmicro>show hidden files to see the core.

  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Program code aborts
Reply #4 - Mar 27th, 2018 at 10:11pm
Print Post  
Tim,

I am narrowing in on the problem(s). First, if I create a class locally and then move it to the library folder, how do I remove it from the local configuration. I have deleted the .h and .cpp files but the code is still not using the right ones. It seems like it has squirreled away it's own copy that I can't find.

AND... how do I force the code to resolve #include "Arduino.h"? It is still showing up as not found (same with Serial). I can see it in the core list. This may be related to my first question, because the reference to "Arduino.h" is in the MotorControllerCommands.h file that I cannot seem to include properly.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program code aborts
Reply #5 - Mar 27th, 2018 at 11:25pm
Print Post  
if you click Build>Clean that deletes all files from the temp build area.

If you use the visual micro "add code" command to add a add>new>cpp/h you will see the correct include syntax

If you manually create new libraries then click rescan to detect the new library
  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Program code aborts
Reply #6 - Mar 28th, 2018 at 12:09am
Print Post  
Tim,

I was looking for the "Clean" command and... there is none. Build has no sub-menu. Love to have that working. Can't find current version, but I think I am on the latest. How do I tell?

By "Rescan" I assume you mean "Refresh" (that's what's in the menu now).

I have multiple libraries I am building on, and many of them make reference to WProgram.h. If they don't find it, pinMode, OUTPUT, Serial .... all indefined. But when I change WProgram.h to Arduino.h, the compiler still doesn't find these. I deleted this whole project from TEMP, but that didn't resolve these problems.

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


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program code aborts
Reply #7 - Mar 28th, 2018 at 12:17am
Print Post  
If the are using visual studio the Build menu is on the top of the ide left of the vMicro menu. It's a standard VS menu item that is available for all projects. Do you have a project open?

There is a Rescan on the Micro Explorer and also on tools>visual micro.
  
Back to top
IP Logged
 
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Program code aborts
Reply #8 - Mar 28th, 2018 at 12:21am
Print Post  
Thanks. I was looking in the wrong place.

Even with Clean and Rescan, I still get this:

Code
Select All
Severity	Description	File	Line	Column	Category
Error	The "VCMessage" task failed unexpectedly.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
   at  messageResourceName, Object[] messageArgs)
   at Microsoft.Build.CPPTasks.VCMessage.Execute()
   at Host.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets	57	5
Warning	182:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]	D:\Users\Bob.ObigOne\Documents\Arduino\MotorController\MotorController.ino	182
Warning	202:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]	D:\Users\Bob.ObigOne\Documents\Arduino\MotorController\MotorController.ino	202
Error (active)	cannot open source file "Arduino.h"	d:\Users\Bob.ObigOne\Documents\Arduino\libraries\L298N_Motor\src\L298N_Motor.h	9	2
Error (active)	identifier "analogRead" is undefined		154	15
Error (active)	identifier "analogWrite" is undefined		62	3
Error (active)	identifier "analogWrite" is undefined		174	2
Error (active)	identifier "analogWrite" is undefined		186	2
Error (active)	identifier "digitalRead" is undefined		156	15
Error (active)	identifier "digitalWrite" is undefined		175	2
Error (active)	identifier "digitalWrite" is undefined		187	2
Error (active)	identifier "digitalWrite" is undefined		198	2
Error (active)	identifier "F" is undefined		58	15
Error (active)	identifier "F" is undefined		149	15
Error (active)	identifier "HIGH" is undefined		175	24
Error (active)	identifier "HIGH" is undefined		188	24
Error (active)	identifier "LOW" is undefined		176	24
Error (active)	identifier "LOW" is undefined		187	24
Error (active)	identifier "LOW" is undefined		198	24
Error (active)	identifier "OUTPUT" is undefined		25	22
Error (active)	identifier "OUTPUT" is undefined		42	22
Error (active)	identifier "pinMode" is undefined		25	2
Error (active)	identifier "pinMode" is undefined		42	2
Error (active)	identifier "Serial" is undefined		58	2
Error (active)	identifier "Serial" is undefined		148	2
Error (active)	identifier "String" is undefined		102	1
Error (active)	identifier "String" is undefined	d:\Users\Bob.ObigOne\Documents\Arduino\libraries\L298N_Motor\src\L298N_Motor.h	23	2
Warning	In function void processSerialInput()	D:\Users\Bob.ObigOne\Documents\Arduino\MotorController\MotorController.ino	-1
Warning	In function void processSSPInput()	D:\Users\Bob.ObigOne\Documents\Arduino\MotorController\MotorController.ino	-1
Warning	showCommandBuffer("SER")
Warning	showCommandBuffer("SSP")
Error	The "VCMessage" task failed unexpectedly.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
   at  messageResourceName, Object[] messageArgs)
   at Microsoft.Build.CPPTasks.VCMessage.Execute()
   at Host.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets	57	5
Error	The "VCMessage" task failed unexpectedly.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
   at  messageResourceName, Object[] messageArgs)
   at Microsoft.Build.CPPTasks.VCMessage.Execute()
   at Host.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets	57	5
Error	The "VCMessage" task failed unexpectedly.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
 

« Last Edit: Mar 28th, 2018 at 12:48pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program code aborts
Reply #9 - Mar 28th, 2018 at 12:47pm
Print Post  
That does not show an arduino build. That is VS trying to build windows C++

Is the project name, folder name and .ino name all same?
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint