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) Cannot build (Read 5454 times)
nick_r
Newbies
*
Offline


Posts: 6
Joined: May 25th, 2020
Cannot build
May 25th, 2020 at 2:00pm
Print Post  
All of a sudden, when I try to build my Arduino project in VS2017, I receive an error (see below).  As far as I know, nothing has changed.   

System.Exception: Build folder disappeared, could not be written or there was an internal problem combining pde/ino files
OR
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Visual.Micro.MiroAppAPI.PdePreprocessor.getPrototypes(String sIn)
   at Visual.Micro.MiroAppAPI.PdePreprocessor.writePrefix(String program, String BuildPath, String SketchName, String[] codeFolderPackages, String morePrefix, Boolean autoGenPrototypes, Boolean alwaysUseRegExToFindIncludes)
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, PdePreprocessor preprocessor, Boolean PreProcessOnly)
   --- End of inner exception stack trace ---
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, PdePreprocessor preprocessor, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchCompilerArduino.TryRunCTags(Board brd, List`1 includePaths, SketchLibraryListUnSorted knownLibs)
   at Visual.Micro.MiroAppAPI.SketchCompilerArduino._compile(SketchBuilder lsketch, String primaryClassName, Boolean verbose, Boolean isDebug)
   at Visual.Micro.MiroAppAPI.SketchCompilerArduino.compile(SketchBuilder lsketch, String primaryClassName, Boolean verbose, Boolean isDebug)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp._CompileDo(Object oProject, Boolean IsDebugStartCommand, Boolean isRebuild, Boolean UseGdbIfAvailable)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Object oProject, Boolean IsDebugStartCommand, Boolean isRebuild, Boolean UseGdbIfAvailable)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.Compile(Object oProject, Boolean IsDebugStartCommand, Boolean IsRebuild, Boolean UseGdbIfAvailable)

I will send a full copy of the log via email as there is plenty of sensitive information in that log file. 

Things I have tried so far:

- upgrading VS 2017 to the latest version
- uninstalled Visual Micro and reinstalled it
- running VS in administrator mode

There are no program code errors and as far as I can tell, I can access the output folder in windows explorer.

I was about to try VS2019 but before I start installing it, I was hoping someone has seen this before.

Thanks in advance.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot build
Reply #1 - May 25th, 2020 at 4:32pm
Print Post  
Please follow the guide in yellow above thanks
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot build
Reply #2 - May 25th, 2020 at 4:34pm
Print Post  
Thanks for the email but it is missing the build properties. You have to enable both "show build properties" and "verbose"

Also easier in a .txt file.

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


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot build
Reply #3 - May 25th, 2020 at 4:54pm
Print Post  
Thanks for the file. The error message is a little miseading because it says it might be problem a) or problem b). It is not a build folder issue.

In this case the generation of missing prototypes for .ino code is falling over some  syntax in the .ino code.

If you could please zip and email the .ino code from your project we will resolve and then delete the code.

There is a config flag to disable the new way that visual micro generates missing prototypes for .ino code which is causing the problem. 

However disabling the new system can cause other build issues, especially if the .ino code uses #defines to include or exclude code or properties on a conditional basis.

If you can send the .ino code we can fix within a day. 

The way to disable the new system temporarily is by using the "vmicro>add code" menu to create a board.txt  file in the project. (Or just create it yourself). Then add the following into it and click save.

Code
Select All
vm.ctags=false 



  
Back to top
IP Logged
 
nick_r
Newbies
*
Offline


Posts: 6
Joined: May 25th, 2020
Re: Cannot build
Reply #4 - May 25th, 2020 at 5:08pm
Print Post  
Thank you for the quick response.  I will email the ino file as requested.   

Will the ino file be sufficient or do you also need the C++ classes as well?  What about the libraries?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot build
Reply #5 - May 25th, 2020 at 7:40pm
Print Post  
It should just be the .ino files

Thanks
« Last Edit: Apr 7th, 2023 at 5:55pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Cannot build
Reply #6 - May 26th, 2020 at 4:13pm
Print Post  
Reviewing the sketch, there are prototypes defined for Setup() and Loop() around line 236.

Can you try commenting these out and re-building to see if it resolves the error?

We will continue to investigate the root cause of the problem and will update when we have more information around this.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Cannot build
Reply #7 - May 26th, 2020 at 7:11pm
Print Post  
There is now an updated release in the forum (20.05.18.4) which will resolve the prototype problem noted above, without the need to remove your prototypes.

Latest Visual Micro Releases

If issues still persist after the update please supply the updated build log when possible.
  
Back to top
IP Logged
 
nick_r
Newbies
*
Offline


Posts: 6
Joined: May 25th, 2020
Re: Cannot build
Reply #8 - May 27th, 2020 at 10:44am
Print Post  
I have installed the latest release as per your link.  VS shows version 2020.518.4.

When I try to build I am still receiving the same message.  I have sent an email with the full log.

Thanks again.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Cannot build
Reply #9 - May 27th, 2020 at 12:28pm
Print Post  
Would it be possible to email the project along with the CPP code and ideally the libraries so we can work through the exact issue?

We are struggling to reliably reproduce this at present, and want to ensure we resolve the correct outstanding issue here.
  
Back to top
IP Logged
 
nick_r
Newbies
*
Offline


Posts: 6
Joined: May 25th, 2020
Re: Cannot build
Reply #10 - May 27th, 2020 at 12:32pm
Print Post  
Yes no problem as long as all copies of the files are removed from your system(s) when testing is complete.

I will prepare the code files for you shortly and email them.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Cannot build
Reply #11 - May 29th, 2020 at 1:15pm
Print Post  
Thanks for the files, and we have identified a couple of issues here:-

1) The latest release (20.05.18.6) contains a fix for the prototype generation to accommodate the scope "::" elements in the function definitions, so they are correctly evaluated for prototypes.

2) There are two prototypes which are slightly different to the function definitions, which causes vMicro to attempt to generate the prototypes for them when this is not needed or desired. These are functions getRadioMetrics and handleReportCellRssi, and aligning these to be exact matches will avoid this.

With both of these in place it got past the build error reported, and only failed due to my guesswork on the libraries to install.

Let us know if this resolves the issue on your side, and we will remove all copies of the software once confirmed.  If there are still problems please upload the latest build log when available.
  
Back to top
IP Logged
 
nick_r
Newbies
*
Offline


Posts: 6
Joined: May 25th, 2020
Re: Cannot build
Reply #12 - Jun 1st, 2020 at 12:27am
Print Post  
Unfortunately still no luck.  Also, I didn't notice any discrepancies in the two prototypes mentioned earlier.

I am happy to diagnosis the issue farther however I am in desperate need to compile and release an update to my software.  What version can I downgrade to in the meantime so that I can compile again?  I am not sure what version the problem was introduced in?

I am happy to upgrade again in a week or so to continue testing.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cannot build
Reply #13 - Jun 1st, 2020 at 11:20am
Print Post  
Please update from this forum to the latest and resend the build output

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Older versions are also in the same area
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Cannot build
Reply #14 - Jun 1st, 2020 at 11:23am
Print Post  
An alternative to downgrading should be to turn off this component:
  • Right Click Project > Add > Local Board.txt
  • Add the below entry to the file, save
    Code
    Select All
    vm.ctags=false 
    
    
  • Rebuild project


The discrepancies mentioned are only due to how we have to match up the declaration to the definition, so if they do not match exactly (all parameter names etc) we may inject additional/incorrect prototypes.

Here we would generate another prototype for myFunction as "void myFunction(int)" <> "void myFunction(int paramOne)", and to avoid this both should be with "paramOne" present.
Code
Select All
void myFunction(int);
void myFunction(int paramOne) { }
 

  
Back to top
IP Logged
 
nick_r
Newbies
*
Offline


Posts: 6
Joined: May 25th, 2020
Re: Cannot build
Reply #15 - Jun 1st, 2020 at 11:39am
Print Post  
I have just emailed the latest output log and an updated ino file containing the corrections to the prototype mismatch.

I will check some of the extra class files to ensure there are no prototype mismatches elsewhere.  If there is an issue with an external library I guess I would be out of luck since I would have to remember to update their prototypes any time the library is updated.

I have applied the ctags workaround as suggested.  Thank you, I can compile again!  Now that it is easy to switch back and forth between the two modes, I am happy to continue testing.
  
Back to top
 
IP Logged
 
Tim SHP
Newbies
*
Offline


Posts: 5
Joined: Sep 21st, 2014
Re: Cannot build
Reply #16 - Apr 7th, 2023 at 2:05pm
Print Post  
Did you ever find what was causing this?

I was getting the same error which was driving me crazy for a couple of days but when I switched on Verbose it stopped?

I'm a bit worried it's going to come back again so if there's any tips to avoid it this'd be great

Cheers
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint