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 "Builds" work consistently..."Rebuilds" fail... (Read 1380 times)
Richard4562
Junior Member
**
Offline


Posts: 21
Joined: Oct 10th, 2016
"Builds" work consistently..."Rebuilds" fail...
Jul 9th, 2019 at 6:48am
Print Post  
I have a sketch the compiles fine on the arduino IDE.

On the Visual Studio Community 2019, I'm seeing the following behaviour on consecutive compiles with no changes to the source program.

Consecutive "Builds" always work...one after another..."Build"..."Build"..."Build".

"Rebuilds" only work if you proceed them by a "Clean Solution" directive.

If you try to do a "Rebuild" after a "Build"...or after a "Clean Solution + Rebuild" (which succeeds)...that second Rebuild will fail.

I'll include 2 files:

"Successful_Clean_Solution_then_Rebuild.txt".
"Failed_Rebuild.txt."

The behavior is very consistent on my machine.
Since I know how to work around it...it won't take me by surprise.

But if it is a generic issue...it may throw users for a loop, as to why things compile...and then they don't.

I'm fuzzy on the difference between "Builds" and "Rebuilds"...I just hit one or the other...assuming both will work.
Maybe what I'm seeing is expected behaviour...and you are expected to do a "Clean Solution" before "Rebuilds".

Windows 7 with latest Updates.
Arduino 1.89
Teensyduino 1.46
Visual Studio Community 2019 16.1.5
Visual Micro purchased last week.


« Last Edit: Jul 9th, 2019 at 6:51am by Richard4562 »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: "Builds" work consistently..."Rebuilds" fail...
Reply #1 - Jul 9th, 2019 at 11:46am
Print Post  
There should be no difference. The rebuild simply says to ignore the cache.

This is the error.

Code
Select All
effect_flange.h: 26:21: fatal error: C:\Windows\TEMP\VMBuilds\audou_002\teensy31\Debug\pch\Arduino.h: No such file or directory
   compilation terminated 



Looking at the teensy build it runs this event/hook to do some magic with the arduino.h. We will have to investigate why your code is looking for the arduino.h in the temp build folder. This is certainly the intention of something similar for Teensy but it needs little investigation before we can know why the hook is failing. It builds okay for us so we will review your config differences.

Why the hook would think there is an Arduino.h in the temp build folder is very weird but I am sure there is explanation.

Code
Select All
recipe.hooks.sketch.prebuild.1.pattern
"H:\arduino-1.8.9\hardware\teensy/../tools/precompile_helper" "H:\arduino-1.8.9\hardware\teensy\avr/cores/teensy3" "C:\Windows\TEMP\VMBuilds\audou_002\teensy31\Debug" "H:\arduino-1.8.9\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -fpermissive -felide-constructors -std=gnu++14 -Wno-error=narrowing -fno-rtti -mthumb -mcpu=cortex-m4 -fsingle-precision-constant -D__MK20DX256__ -DTEENSYDUINO=146 -DARDUINO=10809 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IH:\arduino-1.8.9\hardware\teensy\avr/cores/teensy3" "C:\Windows\TEMP\VMBuilds\audou_002\teensy31\Debug/pch/Arduino.h" -o "C:\Windows\TEMP\VMBuilds\audou_002\teensy31\Debug/pch/Arduino.h.gch" 

« Last Edit: Jul 9th, 2019 at 11:48am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Richard4562
Junior Member
**
Offline


Posts: 21
Joined: Oct 10th, 2016
Re: "Builds" work consistently..."Rebuilds" fail...
Reply #2 - Jul 9th, 2019 at 7:07pm
Print Post  
Well...it only seems to be happening in this specific application.
I have another teensy application that is working fine...and doesn't show this behavior.
I just wanted to point it out because it might show a more generic issue.
What you describe seems to be a specific edge case...so I wouldn't bother.
« Last Edit: Jul 9th, 2019 at 7:12pm by Richard4562 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: "Builds" work consistently..."Rebuilds" fail...
Reply #3 - Jul 9th, 2019 at 10:38pm
Print Post  
Thanks for the report. We have reproduced. The problem was that the recent release of the teensy platform creates a pre compiled header (.pch) that core uses, yet the event that creates the .pch is marked up to run before the sketch code builds. Visual Micro created and cached the core before building the sketch code therefore the event had not run and the .pch had not been created.

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

The link above gives a fix in 1907.9.0

Thanks for the report.
  
Back to top
WWW  
IP Logged
 
Richard4562
Junior Member
**
Offline


Posts: 21
Joined: Oct 10th, 2016
Re: "Builds" work consistently..."Rebuilds" fail...
Reply #4 - Jul 9th, 2019 at 11:22pm
Print Post  
Wow...this sounds so complex...and yet you make it look easy.
Props to you!!!

I use Visual Studio for a lot of WPF Windows coding.

I'm so glad I'm able to work in the same IDE environment for programming microcontrollers.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint