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] 2  Send TopicPrint
Very Hot Topic (More than 25 Replies) Start commands fail, build events fail + How to reference project sources from libraries (Read 16622 times)
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Start commands fail, build events fail + How to reference project sources from libraries
Nov 2nd, 2016 at 4:16pm
Print Post  
This morning I started up VisualStudio 2015, as I've done pretty much every day for the last two plus years, and opened my giant-a$$ project.  When I tried to do a build, I got a null pointer error coming from deep in the bowels of the VS build process.  Assuming some update or other had broken something (which happens with truly annoying regularity on all my PCs and my phone lately...), I installed the latest VisualMicro.  That solved the previous build problem but replaced it with a new one - The build is no longer correctly locating include files.

My project makes extensive use of sub-directories within the project folder, and uses a bunch of libraries from both the Sketchbook libraries folder, as well as the Arduino libraries folder.  Some of the include files from the project directory are not being found when compiling libraries in sub-folders of that directory.  These are included using the normal syntax, for example:

#include "SuperATCDef.h"

Even giving a path starting with "../" does not help.

What has changed in the include handling in this version, and how do I fix it? ASAP??  I'm dead in the water here...

Regards,
Ray L.
« Last Edit: Dec 1st, 2016 at 1:22am by Tim@Visual Micro »  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #1 - Nov 2nd, 2016 at 4:30pm
Print Post  
It appears this problem may have been fixed in the Oct 23 release, but that is NOT what gets installed by clicking on the button on the Downloads page.  That installed v1.1609.4, which seems relatively ancient.

Where do I get the more recent versions??  If there's a way to find them through the website, it is not at all obvious....

Regards,
Ray L.
  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #2 - Nov 2nd, 2016 at 4:51pm
Print Post  
One more comment:  You have a "previous versions" link to OneDrive, which has about a bazillion previous versions of the installer, ALL of which have the same file name, and there is no indication whatsoever of what VERSION each one is.  The Release Notes page refers to VERSION numbers, but gives no clue how to download any specific version.  Why make this so difficult?  Each Release Note should contain a download link for the corresponding version, and each link on the OneDrive page should have a filename containing the version number.  I'm dead in the water, and can't even go back to the version that's been working for me for the last year....

Regards,
Ray L.
  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #3 - Nov 2nd, 2016 at 5:29pm
Print Post  
Very confused here....  Tools->Options->VisualMicro->Version shows v1.1609.4.  But Tools->Extensions & Updates shows v1610.27.0.  I un-installed, then re-installed VisualMicro, which no change.  Include Paths seem badly broken in this version.

Regards,
Ray L.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #4 - Nov 2nd, 2016 at 5:38pm
Print Post  
The extensions and updates is the right place to look

Have you posted verbose output for this issue?
  
Back to top
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #5 - Nov 2nd, 2016 at 5:48pm
Print Post  
Tim,

Verbose output attached.

Regards,
Ray L.

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #6 - Nov 2nd, 2016 at 5:55pm
Print Post  
Tim,

BTW - The file is complains about, "SuperATCDef.h", IS in the build directory, but neither the build directory, nor the original source directory (Users\RayL\Arduino\SuperATC) is specified as an Include path in the compiler command.

The same error seems to occur for all .h files in the root directory of the solution.

Regards,
Ray L.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #7 - Nov 2nd, 2016 at 6:18pm
Print Post  
Are the files included in the solution. Right click include?
  
Back to top
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #8 - Nov 2nd, 2016 at 6:18pm
Print Post  
Tim,

Whatever is broke, it's been broke for a long time.  I've gone back to v1511.23.0, and it seems to be working again.  I tried several versions from 2016, and none worked.  I don't know exactly what version this issue crept in at, but I could find it if necessary, by installing all previous versions in reverse order.

Regards,
Ray L.
  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #9 - Nov 2nd, 2016 at 6:21pm
Print Post  
Tim@Visual Micro wrote on Nov 2nd, 2016 at 6:18pm:
Are the files included in the solution. Right click include?


Tim,

You're asking if those files are included in the Solution Properties?  Yes, they are, and have been for about two years now.  The Solution has not changed, I've only been making updates to individual files.  It was working when I went to bed last night, and no longer working when I started working this morning, throwing the VS build error instead.  Updating VM solved the VS build error, but replaced it with this file include error.  Going back to a year-old version of VM (1511.23.0) has the build working again.  So, you've broken something somewhere between 1511.23.0 and the current version.

Regards,
Ray L.
  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #10 - Nov 2nd, 2016 at 6:41pm
Print Post  
Something else that is now broken - I had a post-build event setup, which ran a batch file to copy the binary to a network drive.  That batch file is no longer being run, and I can't for the life of me figure out where/how to set that up again...

Regards,
Ray L.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #11 - Nov 2nd, 2016 at 7:04pm
Print Post  
Well a year ago visual micro compiled the files in the arduino sketch folder automatically even if not included in the solution explorer. The solution explorer has two views, one shows files on disk and one shows the files actually included in the project so there is room for confusion. 

A year ago we also did not have "vMicro>Compiler>Deep Search"

Last night you were running a recent build so that shows the recent builds worked okay

You setup the hook/post build event in the arduino hardware platform.txt if that has stopped working then it suggests you have updated your arduino hardware definition via board manager. It's the only way to update/overwrite those changes.

Switching on verbose and also "show build properties" will show us what you have and what is happening when you compile. 

« Last Edit: Nov 2nd, 2016 at 7:05pm by Tim@Visual Micro »  
Back to top
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #12 - Nov 2nd, 2016 at 7:21pm
Print Post  
Tim,

Several things don't make sense in what you've said:

"Last night you were running a recent build so that shows the recent builds worked okay"  - No, until today, I had not updated VM in many months.  I don't recall exactly when I last updated, but is was probably back around last Spring or early Summer at the latest.  It has certainly been quite a while.

"You setup the hook/post build event in the arduino hardware platform.txt if that has stopped working then it suggests you have updated your arduino hardware definition via board manager. It's the only way to update/overwrite those changes."

I'm running Arduino v1.6.5, installed 4/15/2016, and unmodified since that time.  I don't recall ever modifying platform.txt, and certainly not anytime at all recently.  I am running Due, and the platform.txt in the Due package was last modified 11/22/2015, which is probably when I installed Arduino v1.6.4.  I seem to recall there being an item in some VS properties dialog that let me setup the post-build event command line.  I did it ages ago, and haven't had to touch it again until now.  I see nothing in platform.txt that suggests anything having to do with post-build events...

Regards,
Ray L.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #13 - Nov 2nd, 2016 at 7:47pm
Print Post  
One thing that has changed in all those months is that the project folder path has been removed from the -include paths because arduino has tightened the build specification. It should never have been required because the build is from the temp folder so was confusing. 

The files included in the solution explorer (not just that they appear in 'all files mode' but have been included in the visual studio project properly) are copied to the temp build folder so if missing then they have not been included. The files in the root of the project are always copied to the build folder.

The arduino platform.txt hooks have always been supported but visual micro has never run any vs events. Maybe there was some other vs config that overrode and ran them. The vs build events which you should see when right clicking a project > properties. It's possible from what you are saying that 


if you email the .vcproj files and verbose output with build properties enabled we can see what is included in the build and the project.

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #14 - Nov 2nd, 2016 at 8:15pm
Print Post  
ps: you can add the sketch folder include yourself if need be. it could also be an option but I am not sure its relevant.
  
Back to top
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #15 - Nov 2nd, 2016 at 8:26pm
Print Post  
Tim,

The file it complains about, SuperATCDef.h, IS included in the project properties, and IS copied to the build folder, but still is not found when compiling a library from the Sketchbook/libraries folder.  What seems really odd to me is that it is compiling MiniI2CSlave2.cpp, which includes SuperATCDef.h.  SuperATCDef.h is copied to the build directory.  A MiniI2CSlave2 subdirectory is created, but is left empty!  It does NOT copy MiniI2CSlave2.h or MiniI2CSlave2.cpp to the build directory.

Here isi the command line that fails (with linebreaks inserted to make it readable here...):

Using library MiniI2CSlave2 version 0.0.0 in folder C:\Users\RayL\Documents\Arduino\libraries\MiniI2CSlave2
c\4.8.3-2014q1/bin/arm-none-eabi-g++" 
-c -g -Os -w -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions 
-Dprintf=iprintf -MMD -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=10605 
-DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM -D__SAM3X8E__ -mthumb -DUSB_VID=0x2341 
-DUSB_PID=0x003e -DUSBCON -DUSB_MANUFACTURER="\"Unknown\"" 
-DUSB_PRODUCT="\"Arduino Due\"" 
ystem/libsam" 
ystem/CMSIS/CMSIS/Include/" 
ystem/CMSIS/Device/ATMEL/" 
-I"C:\Users\RayL\Documents\Arduino\libraries\ATCFPGA2" 
-I"C:\Users\RayL\Documents\Arduino\libraries\DueRealtimeClock" 
-I"C:\Users\RayL\Documents\Arduino\libraries\DueTimer" 
-I"C:\Users\RayL\Documents\Arduino\libraries\EncoderClass" 
-I"c:\Arduino\Arduino-1.6.5\libraries\Ethernet\src" 
-I"C:\Users\RayL\Documents\Arduino\libraries\HBridgeClass" 
-I"C:\Users\RayL\Documents\Arduino\libraries\I2CEEPROM" 
-I"C:\Users\RayL\Documents\Arduino\libraries\I2CScan" 
-I"C:\Users\RayL\Documents\Arduino\libraries\LiquidCrystal_I2C" 
-I"C:\Users\RayL\Documents\Arduino\libraries\MiniI2CSlave2" 
-I"C:\Users\RayL\Documents\Arduino\libraries\NewAnalogButtons" 
-I"C:\Users\RayL\Documents\Arduino\libraries\NullConsole" 
-I"C:\Users\RayL\Documents\Arduino\libraries\PIDRampClass" 
-I"C:\Users\RayL\Documents\Arduino\libraries\PIDServoClass" 
-I"C:\Users\RayL\Documents\Arduino\libraries\PWMClass" 
-I"C:\Users\RayL\Documents\Arduino\libraries\RealtimeClock" 
ibraries\SPI" 
-I"C:\Users\RayL\Documents\Arduino\libraries\TelnetConsole" 
-I"C:\Users\RayL\Documents\Arduino\libraries\WebServer" 
ibraries\Wire" 
-I"c:\Arduino\Arduino-1.6.5\libraries" 
ibraries" 
-I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\hosdztsc.hhw\Micro Platforms\default\debuggers" 
-I"C:\Users\RayL\Documents\Arduino\libraries" 
ores\arduino" 
ariants\arduino_due_x" 
"C:\Users\RayL\Documents\Arduino\libraries\MiniI2CSlave2\MiniI2CSlave2.cpp" 
-o CSlave2\MiniI2CSlave2.cpp.o"
 
MiniI2CSlave2.cpp: 2:25: fatal error: SuperATCDef.h: No such file or directory
   #include "SuperATCDef.h"
   compilation terminated

So, it appears to be building the library from the source in the sketchbook/libraries/MinI2CSlave2 folder, but is not finding the include file which is in the build folder.

Regards,
Ray L.
  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #16 - Nov 2nd, 2016 at 11:44pm
Print Post  
I have been completely unable to get the post-build event working again.  I can specify the command line (in ProjectProperties->BuildEvents), but it does not get run when I do a build.  I have no clue what I'm missing, but I'm 99% certain I set this up before, with your help, entirely within VisualStudio.

Any progress on understanding the include problem?  Did you get the project file and verbose build output I e-mailed you this AM?

Regards,
Ray L.
  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #17 - Nov 3rd, 2016 at 4:55am
Print Post  
I have gotten the post-build event to work, to copy the bin file to a network drive.  I added this line to the Due platform.txt"

recipe.hooks.objcopy.postobjcopy.2.pattern=cmd.exe /c copy "{build.path}\{build.project_name}.bin" "\\10.0.0.10\public\Arduino" 

But, this is absolutely not the way I did it last time.  I wish I knew how I did it the last time...

Regards,
Ray L.
  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #18 - Nov 3rd, 2016 at 4:15pm
Print Post  
Tim,

After spending some time dissecting and comparing the output from both old (working) and new (not working) versions of VM, it seems clear to me that the problem is that the newer versions of VM do NOT include the build directory with a -I option on the compiler command line.  The file in question IS included in the solution (with All Files turned off).  To make doubly sure, I removed, then re-added it, with no change.

So, this appears to me a bug in the more recent VM builds.

What is my solution?

Regards,
Ray L.
  
Back to top
 
IP Logged
 
RayLivingston
Full Member
***
Offline


Posts: 158
Location: California
Joined: Nov 24th, 2012
Re: HELP! Latest VisualMicro Has Badly Broken My Solution
Reply #19 - Nov 3rd, 2016 at 4:22pm
Print Post  
Just to prove the point, I added "-I{build.path}" to the c/c++ build recipes in platform.txt, and i can now build with the latest VM.

So, the problem manifests when you compile a library (from Sketchbook/libraries) that #includes a header file from the project directory.  Perhaps somewhat of a pathological case, but it really SHOULD still work...

Regards,
Ray L.
« Last Edit: Nov 3rd, 2016 at 4:24pm by RayLivingston »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint