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) Adding linked file from another project failed after upgrade (Read 6889 times)
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Adding linked file from another project failed after upgrade
Feb 22nd, 2017 at 2:04am
Print Post  
Hello, after I upgraded to a new version (PRO) from older (FREE) version I started getting errors I hadn't have before. 
See attached a screenshot ...
One is "not found" includ IFC.h file which is added as a link to that named file located in another project (another folder). I added it according to the VisualMicro manual by creating a link in file's location and then adding that link to Avionics_slave project.
Interesting - in Solution Explorer I see this added file, I can open it no problem and solution explorer shows all the "internals" of this file, yet
the main project file - Avionics_slave.ino does not see it ! Trying to open reports:
Quote:
"File "IFC.h" not found in current source file's directory or in build system paths"

Is this inconsistency  a mismatch between a compiler and Intellisense ? or what?
Thanks in advance for any help
Vlad

  

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


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding linked file from another project failed after upgrade
Reply #1 - Feb 22nd, 2017 at 12:49pm
Print Post  
Thanks for the message I can look into the short cuts issue however it is not clear if the build works.

Please switch on vmicro>compiler> verbose and also "show build properties". then build and email the output as a .txt to info[at]visualmicro.com. Include a link to this post in the email.


It's possible that something broke with the older short cut system and we will fix that quickly. However you should look at using shared projects instead of short cuts. Shared projects were released a few months ago and are often much better to work with than lone short cuts.

Share code between projects
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding linked file from another project failed after upgrade
Reply #2 - Feb 22nd, 2017 at 1:41pm
Print Post  
I have tested this. The build is working okay

The issue is an intellisense issue related to the new source control friendly "relative" paths used for intellisense.

Will be fixed in next release. Thanks for the update.
  
Back to top
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Adding linked file from another project failed after upgrade
Reply #3 - Feb 22nd, 2017 at 6:53pm
Print Post  
Thank you Tim, this Intellisense problem is what I expected the most.
I compiled and have the verbose txt file of output but it will not be of any help as I don't see any compiler's mentioning of IFC.h file...
the reason been - the compilation failed in other library compile problem with another file SPI_Anything.h which I reported in another thread... Although I set compiler option to not stop on error, looks it still stopped compiling libraries after error report about SPI_Anything.h errors. After this last error get fixed, then I'll be able to see what does compiler report about IFC.h (missing or not).
Thanks again 
Vlad
  
Back to top
 
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Adding linked file from another project failed after upgrade
Reply #4 - Feb 22nd, 2017 at 8:48pm
Print Post  
Tim, - about the ambiguity of adding include file by it's link.
I followed each step described in visualmicro man page - created a link named the same as original file - and indeed IFC.h file got added in the solution explorer, but the entry in .vcxproj file is ambiguous :
Quote:
<ClInclude Include="..\IFC_vs\IFC.h" />
   
since both: real file and link are named the same (IFC.h), how does VS know which one to add to the project? If they are named the same what is the purpose of making a link?
Sincerely
Vlad
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding linked file from another project failed after upgrade
Reply #5 - Feb 22nd, 2017 at 10:00pm
Print Post  
Adding linked short cuts to code files is a standard visual studio feature. If you move the code file after adding a short cut then you will need to re-add the short cut otherwise it will point to an invalid location.

If you click Build>Rebuild you will see a full compile. If that fails because of a missing #include then you must correct the problem.

The "Stop on Error" does not affect a successful compile. It simply stops trying to compile other files when the build is going to fail anyway. The result with "stop on error" is less error output but still the build will fail regardless.

Does the build work in the arduino ide?
  
Back to top
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Adding linked file from another project failed after upgrade
Reply #6 - Feb 22nd, 2017 at 10:50pm
Print Post  
No, it does not work in Arduino IDE... the way how VS added link to include file in another folder -is not "known" to Arduino IDE...
I never run this project in Arduino IDE before (my main project is too large - not manageable in Arduino IDE).  Avionics_slave.ino is rather small - I tried it now - errors: IFC.h is not found.
But in VS + vMicro no such errors in compilation - only library compilation errors which I reported in other thread.
-------------
My link is correct - I wouldn't dare to move the main file after creating a link to it  Smiley

  
Back to top
 
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Adding linked file from another project failed after upgrade
Reply #7 - Feb 22nd, 2017 at 11:13pm
Print Post  
I am sorry I still can't understand what for creating a link to a file IFC.h and keep that link in the same directory where the original is? if VS only adds to a project file the link to the same folder where original file is
  Quote:
<ClInclude Include="..\IFC_vs\IFC.h" />

no difference from using the same link to original file located in the same folder...
...or did you mean to move that link to the folder of target project but forgot to mention it in the man pages?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding linked file from another project failed after upgrade
Reply #8 - Feb 23rd, 2017 at 12:20pm
Print Post  
You can link a file from a different folder so that the file can be used in more than one project.



..\IFC_vs\IFC.h
This might simply be vs relative paths showing an original not a linked file. I don't know you folder structure so I can only tell you what options there are. Visual micro doesn't get involved, it's just standard vs capabilities we are are discussing there.

Maybe have some language confusion you can zip and email your entire project if you need me to understand something that I am missing.


ps: To test in the arduino ide you can temporarily copy sources into a project folder.
« Last Edit: Feb 23rd, 2017 at 12:23pm by Tim@Visual Micro »  
Back to top
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Adding linked file from another project failed after upgrade
Reply #9 - Feb 23rd, 2017 at 6:24pm
Print Post  
birdman wrote on Feb 23rd, 2017 at 6:19pm:
I'll clarify here my previous message.
Please read the last part of vMicro man page about Adding Source Files from Other Projects - Sharing Source Files:
http://www.visualmicro.com/page/User-Guide.aspx?doc=Add-Source-Files.html

#3 creating a link
#4 renaming it to match the same name of the source file
at this point link is still located in THE SAME FOLDER WITH ORIGINAL FILE... did you mean to move it to the target folder but forgot to mention?
#5 Add the shortcuts to your project in the same way as you would add "real files"  
did you assume the link to be in the target folder at this point? though this move was missing above ?
------------
assuming that move above suppose to take placed but was mistakenly omitted, then comes my 2nd point: 
what is a difference comparing adding a link (if correctly done above) versus link to the original file created inside the project file as in my example Quote:
Quote:
<ClInclude Include="..\IFC_vs\IFC.h" />

I thought "linked way" would make code compatible with Arduino IDE because Arduino does not read .vcxproj file, but unfortunately Arduino IDE does not recognize links either...

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


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding linked file from another project failed after upgrade
Reply #10 - Feb 23rd, 2017 at 7:01pm
Print Post  
That's right. With arduino you just have static projects. However you can copy all the files into the project folder for testing.
  
Back to top
IP Logged
 
birdman
Junior Member
**
Offline


Posts: 20
Joined: Sep 24th, 2016
Re: Adding linked file from another project failed after upgrade - solved
Reply #11 - Feb 23rd, 2017 at 10:24pm
Print Post  
Tim, I confirm that you figured out right from the beginning - the error of "include file not found" was only reported by Intellisense. I compiled successfully and after compilation Intellisense still showed missing include file.
I think this will be fixed in the future releases.
Meanwhile I eliminated this error by simply making a custom library of the shared include file only.
Doing that is simple, equally well understood by VS-vMicro compiler, by Intellisense and by Arduino IDE... , no errors reported, VS environment is making easy library files access - I can't see any advantage to use any other method with more steps involved.
Thank you for help
Vlad
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding linked file from another project failed after upgrade
Reply #12 - Feb 24th, 2017 at 1:24am
Print Post  
Sneaky nice idea:)

Yes the intellisense issue with (individual source code short cuts) is now fixed and the release will be available over the next day or two

Thanks for the update.
« Last Edit: Feb 24th, 2017 at 1:25am by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12137
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Adding linked file from another project failed after upgrade
Reply #13 - Feb 24th, 2017 at 10:08pm
Print Post  
Off-Topic replies have been moved to this Topic.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint