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) Pro version can't find my source files in subfolder (Read 20724 times)
gofishing
Junior Member
**
Offline


Posts: 27
Joined: May 3rd, 2016
Pro version can't find my source files in subfolder
May 9th, 2016 at 8:24pm
Print Post  

I finally decided to update to pro version. after installation I put in my key, it shows "Registered". I have Arduino 1.68, Teensy 1.28. visual micro is 1605.6.0

after reboot VS 2015, it won;t build my project, it keeps telling me, can't find any of my sources in other sub folders.


HeadUnit_GNR.ino:7:44: fatal error: ..\..\Common\DS2401\UID_DS2401.h: No such file or directory
:#include <..\..\Common\DS2401\UID_DS2401.h>

what's wrong?
  
Back to top
 
IP Logged
 
gofishing
Junior Member
**
Offline


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #1 - May 9th, 2016 at 8:36pm
Print Post  

please note that I was arranging all my source codes in different sub-folder for code sharing. I do not make them as libraries, simply references the same way how it puts in the *.vsarduino.h.

this was WORKING in the trial version I used before(I do not know the version I used).

by upgrading to Pro, it breaks the build.



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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #2 - May 9th, 2016 at 9:13pm
Print Post  
Hi,

The pro license key doesn't affect this so we need to understand a little more about your project.

Please zip and email your vcxproj file so that I can see how you have linked the external sources.

You can also prove this by switch on "tools>options>visual micro>system>pause pro features" then re start the ide

Thanks
« Last Edit: May 9th, 2016 at 9:15pm by Tim@Visual Micro »  
Back to top
IP Logged
 
gofishing
Junior Member
**
Offline


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #3 - May 9th, 2016 at 9:40pm
Print Post  
this is what I have, which I use it since very beginning with visual micro.

I put all my cpp/h in different folders, you can see from below sample *.vsarduino.h file how there reference them(see on the very bottom of the file). I use the same path, for example,  #include <..\..\Common\DS2401\UID_DS2401.h, 

every time I need to reference those files in my ino file. the IDE SEE the include file, no compliant. only when build time it can't see it. why?

Code
Select All
/*
	Editor: http://www.visualmicro.com
	        visual micro and the arduino ide ignore this code during compilation. this code is automatically maintained by visualmicro, manual changes to this file will be overwritten
	        the contents of the Visual Micro sketch sub folder can be deleted prior to publishing a project
	        all non-arduino files created by visual micro and all visual studio project or solution files can be freely deleted and are not required to compile a sketch (do not delete your own code!).
	        note: debugger breakpoints are stored in '.sln' or '.asln' files, knowledge of last uploaded breakpoints is stored in the upload.vmps.xml file. Both files are required to continue a previous debug session without needing to compile and upload again

	Hardware: Teensy LC, Platform=teensy3, Package=teensy
*/

#ifndef _VSARDUINO_H_
#define _VSARDUINO_H_
#define __HARDWARE_MKl26z64__
#define __HARDWARE_MKL26Z64__
#define _VMDEBUG 1
#define __MKL26Z64__
#define TEENSYDUINO 128
#define ARDUINO 10608
#define F_CPU 48000000
#define USB_SERIAL
#define LAYOUT_US_ENGLISH
#define __cplusplus 201103L
#define __arm__
#define __ARM__
#define __extension__
#define  __attribute__(x)
typedef void *__builtin_va_list;
#define __extension__
#define __ATTR_PURE__
#define __ATTR_CONST__
#define __inline__
#define __asm__
#define __volatile__

#define NEW_H

#include <arduino.h>
#define __arm__
#define __ARM__
#define __extension__
#define  __attribute__(x)
typedef void *__builtin_va_list;
#define __extension__
#define __ATTR_PURE__
#define __ATTR_CONST__
#define __inline__
#define __asm__
#define __volatile__

#define __disable_irq() __asm__ volatile("");
#define __enable_irq()	__asm__ volatile("");

//#define sei() __enable_irq()
//#define cli() __disable_irq()
//#define interrupts() __enable_irq()
//#define noInterrupts() __disable_irq()

#define NEW_H
#include <HeadUnit_GNR.ino>
[b]#include <..\..\Common\DS2401\OneWire.cpp>
#include <..\..\Common\DS2401\OneWire.h>
#include <..\..\Common\DS2401\UID_DS2401.cpp>
#include <..\..\Common\DS2401\UID_DS2401.h>[/b]
#endif
 


« Last Edit: May 9th, 2016 at 9:45pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #4 - May 9th, 2016 at 9:45pm
Print Post  
Hi,

Yes I could see how you have used a common folder above or sibling to your main project.

Arduino compile does not normally support this combination but I agree that Visual Micro does as long as the files are linked as shortcuts.

I asked to have a zip and email with your vcxproj file so that I can see how you have linked the external sources. Email is info [at] visualmicro.com

If this is a bug then it is a result or bug relating to upgrading to the latest visual micro and unconnected to the pro version.

Thanks
« Last Edit: May 9th, 2016 at 9:46pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #5 - May 9th, 2016 at 9:59pm
Print Post  
Hi,

I have your email but it again contains the vsarduino.h code and does not provide the .vcxproj file from your project folder.

I have re-looked at your report and believe you were working outside of published guidelines. I am sure we can help you get it working again but I believe it has stopped working because recent version of visual micro build into a new temporary folder location. 

AND I can only assume that previously you had built the shared sources as a "real" project (not using shared code). The build would have copied the source code to the temp build folder so that it was available to the compiler via "..\..\"

When an Arduino project is compiled it happens in a temporary folder so the source code would not find ..\..\ unless the code was located in the temp build location. Visual Micro will not copy code outside of each projects temp build area so I know that ..\..\ can only resolve correctly if the source code arrives by other means.

Can you confirm that you have these sources in a real "un-shared" project and that you have previously built the project using visual micro?

  
Back to top
IP Logged
 
gofishing
Junior Member
**
Offline


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #6 - May 9th, 2016 at 10:01pm
Print Post  

sorry, machine is in the middle of the update.

I created a simple project to use sub-folder. in the zip. it can't build for me.

  

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


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #7 - May 9th, 2016 at 10:39pm
Print Post  

shared code means I am sharing the same source files with other projects, it just another folder, not sure about your definition. please look at my test project I sent you. it is quite simple. I have files in other sub-folder, and it won't build.

not sure, your assertion about me working outside published guideline. your document clearly state the it supports source file in sub-folders. this is a deal breaker for me.


the zip file has all files in it.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #8 - May 9th, 2016 at 10:57pm
Print Post  
Hi

Thanks for the files I am looking at them.

Actually you are not working with source code in sub folders. This means sub folders of the current project folder.

You are working with source code from other folders on your pc not other sub folders.

I am not concerned with a small purchase. Most of what I do is for free and you have confirmed you had previously a working system in both trial/pro and free mode. 

So you are reporting a problem since you upgrade to new release and unconnected with any "deal".

I am looking into this for you because I have done that for many years for many people. It's irrelevant to me about any "deal" I just like to see the software working (free or paid)  Smiley

In this case you have included files into source code using relative path syntax that takes us outside of the project by a couple of parent folder levels. This is not documented anywhere and if you considered how an Arduino build works where multiple .ino files are combined into a single .cpp you would know that the compile will always be from a temp folder and that will mean that "..\..\" makes no sense.

So my investigation is to see why your include of #include <..\..\Test2\UID_DS2401.h> worked in earlier versions and to provide a solution for you. A solution that is robust and within more obvious limits.

I don't know which version of visual micro you were using previously but there has been work in the area of allowing both code in sub folders (of the project) and also to support linked code from other locations on your computer.

From what I can see you are using linked code which I am currently testing and think I have identified some issues.

More later today or tomorrow.

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


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #9 - May 9th, 2016 at 11:09pm
Print Post  

thanks, await for your solutions. I have more than 20 projects currently become non-buildable, that's why I meant it is a big deal for me.

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #10 - May 9th, 2016 at 11:15pm
Print Post  
Understood, yes it's a big deal and should work. Thanks
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #11 - May 10th, 2016 at 12:08am
Print Post  
Try the new release in tools>extensions and updates>online. release 1605.10

There is a fix for linked project sources and also a clarification of the rules. There can be an option to control how linked sources work if this doesn't work for you but I hope you find that your existing project config works again.

Shared Source Code Rules/Tips:-

  • It is important to bear in mind that linked sources are copied to the temp build folder and then compiled. 
  • Linked source code should be considered as if the code exists in the current project folder (same place as the [project_name].ino). 
  • #includes in the code can be relative or fixed however because the source code is copied to the build folder the compiler will actually find the code in the local build temp folder and will ignore the path specified in the #include. 
  • This means that it is only intellisense that uses the path of an #include statement.

This config works best because it allows the linked source code to be debugged and also provides clarity over what will actually be compiled. However this system prevents shared source code from further referencing any .h files that are not also included in the project.

If required we could have a switch to force the linked files to be compiled from their true location but best avoided if possible.

A future feature might be to recursively find source code #included in shared sources.

Look forward to hearing your comments
« Last Edit: May 10th, 2016 at 12:27am by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #12 - May 10th, 2016 at 11:44am
Print Post  
Did you try the update? All working now?
  
Back to top
IP Logged
 
gofishing
Junior Member
**
Offline


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #13 - May 10th, 2016 at 4:45pm
Print Post  
yes, just did, and with few changes it builds now. THANKS!

instead of 
#include <..\..\Test2\UID_DS2401.h>
I changed to
#include "UID_DS2401.h"

couple comments;
1. thanks for quick turnaround!
2. I was aware of that the tool somehow flatten the files while compiling.
3. this version is treated all files in a flatten folder structure. I am ok with it, since Intellisense is not red flag it. it is a bit odd though, since the current folder should be the file been complied. any files should be relative to it. it will be great in the future version that it will do that. and you can do your magic to flatten it behind the scene.
4. I will also suggest to honor the VC project settings on locations of the additional include files. I tried that it does not work.

I will modify rest of my projects to accommodate the changes.

you mentioned there is option to control how link files work. could you tell me where?

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #14 - May 10th, 2016 at 4:54pm
Print Post  
Thanks for the update. I have a couple of questuions

1) Why change the #include. In my test I was able to add a relative include which intellisense was happy with and compile still worked. I am not sure intellisense will work fully without the <..\..\Test2\UID_DS2401.h>. Did it fail for you with <..\..\Test2\UID_DS2401.h> ?

2) Are we talking about the same thins?? The VS include paths are automatically maintained by visual micro so that hardware and library paths are correct. Are you suggesting you want to change these paths or maybe you are talking about a different path property? Can you give screen shot of the additional paths property you want to set?

3) In the visual micro project properties you can add -I"path" switches to the compiler flags. This might be useful for you but be careful because unless cpp files are linked into the project they will not be compiled.

4) For flattening we have to be careful. If the temp build folder is "winTemp\VMicro\Sketch1" it becomes a problem to step ..\..\



  
Back to top
IP Logged
 
gofishing
Junior Member
**
Offline


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #15 - May 11th, 2016 at 4:42pm
Print Post  

sorry for late reply, there was other urgent issues need to be addressed.

#include "UID_DS2401.h", is only way for me to work.

the following are all failed on me,

#include <UID_DS2401.h>
#include <..\..\Test2\UID_DS2401.h> 
#include "..\..\Test2\UID_DS2401.h"


on the previous build(not sure which) it was fine.

not sure, what's different between us, I have VS 2015 update 2 installed.



  
Back to top
 
IP Logged
 
gofishing
Junior Member
**
Offline


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #16 - May 11th, 2016 at 5:03pm
Print Post  

also, when I tried to open the same test project in VS2013. VS2013 crashed.

I installed the same version of vMicro into VS2013.

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #17 - May 12th, 2016 at 12:24am
Print Post  
Did the crash happen when you tried again?

I think I found something about the shared code that might help. I should have asked you to say approx how old your previous version of visual micro was.

Towards the end of last year arduino introduced a new automatic library discovery system. It was implemented in visual micro a couple of months ago. I think it's confused by relative paths and am looking into that.

However you can switch it off by un-ticking "vMicro>Deep Search Includes". Please try that to see if your compile is back to using <#include "..\.. or whatever you had before.

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


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Pro version can't find my source files in subfolder
Reply #18 - May 12th, 2016 at 1:54pm
Print Post  
The update yesterday shows a clearer error and message during build if you have shared code using relative includes. 

The message clearly says that you need to switch off the "deep search includes" option on the vMicro menu.

Relative paths should be working and are recommended.

include <..\..\Test2\UID_DS2401.h> 
#include "..\..\Test2\UID_DS2401.h"

A new feature has been removed from the open existing arduino project which might have contributed to the vs2013 crash
  
Back to top
IP Logged
 
gofishing
Junior Member
**
Offline


Posts: 27
Joined: May 3rd, 2016
Re: Pro version can't find my source files in subfolder
Reply #19 - May 12th, 2016 at 5:05pm
Print Post  

switch off deep search includes does not help. still can't find the relative path in any form. build failed in my sample project.

the problem is that with relative path, intellisense find it, but vMicro build failed. with no path provided, vMicro build fine, but intellisense can't find the file.

I beleive the .10 version is busted. in VS2013, simple try to create a blank project cause VS2013 to crash.

yes, the version I used was early this year. the only update I had was when I switch to Pro version  and update the version, last week.

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint