VS Arduino | |
>> >> Local Files Override Library Files not being honored?
https://www.visualmicro.com/forums/YaBB.pl?num=1585150107 Message started by FrankP on Mar 25th, 2020 at 3:28pm |
Title: Local Files Override Library Files not being honored? Post by FrankP on Mar 25th, 2020 at 3:28pm
Hi,
I have a VS2019 project with 12C_Anything.h in the local folder, but the compiler keeps insisting on using the version in my Library folder. I have another identical (with respect to includes) project with 12C_Anything.h in the local folder and this one compiles file, using (I think) the local version. Both projects have 'deep search' and 'Local Files Override Library Files' checked. I have included the verbose compile output for both. What am I missing here? TIA, Frank https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=LocalFileProblem.zip ( 4 KB | 13
Downloads )
|
Title: Re: Local Files Override Library Files not being honored? Post by Visual Micro on Mar 25th, 2020 at 5:10pm
If the file included in the project/solution?
If it included in the sketch code? What syntax used to include? Is "vMicro>Compiler>Add Include Path for Project" enabled? |
Title: Re: Local Files Override Library Files not being honored? Post by FrankP on Mar 25th, 2020 at 7:07pm
Tim,
Here's the 'local file honored' code: Code (c++):
And the 'not honored' code Code (c++):
The 'I2C_Anything.h' file is in the local directory in both cases, and it is NOT included as a header file resource in either VS project. In both cases, 'Local Files Override...' is checked in VMicro->Compile options. Hope this helps. Frank |
Title: Re: Local Files Override Library Files not being honored? Post by Visual Micro on Mar 25th, 2020 at 11:06pm
The "local files override ..." only applies to files that are compiled (.cpp, .c, .S) to object files.
Header files are discovered based on include paths when needed by the compiler. The compiler output will show the include paths. It is important to ensure files are included correctly in the vs project. |
Title: Re: Local Files Override Library Files not being honored? Post by FrankP on Mar 26th, 2020 at 2:07am
Tim,
I didn't understand about headers vs .cpp files, so thanks. However, that doesn't explain why the local file IS used in one VS project, and not in the other, since it isn't included as a resource in either project. And, IIRC, I actually DID include the the I2C_Anything.h file in the VS project at one point, but it didn't change the outcome. Hmm, maybe I have to include that header file in the SOURCE FILE section rather than the header file section? Frank |
Title: Re: Local Files Override Library Files not being honored? Post by Visual Micro on Mar 26th, 2020 at 2:28pm
I think you should click the little "show all files" button above the solution explorer so that you can see where your files really are.
If you are looking at the view that shows "header files" and "source files" seperately that is "virtual mode" which just presents the files in a grouping. An arduino project has only the main project folder and \src folder or unlimited levels of folders below the \src. There will not be "Source Files" or "Headers Files" folders. The F4 properties on a file or folder will also show you clearly if a virtual filtered folder of (*.h or *.cpp) files or a physical location. Visual Micro does not need to and should not take into account the virtual mode display except that it does clearly show which files are included in the project. The files that are included in a project can be important for intellisense and also in some cases for compilation. It's true that generally for arduino everything in the allowed folders is copied to temp folder and then compiled but the vs project system does give opportunity to include/exclude certain files from te build. It is an area of difference between what VS users would expect and what Arduino users expect. If I recall correctly, Visual Micro has settings to control this but generally files in the project folder are copied to the build folder and compiled. Files in \src and below are only copied and compiled if included in the project. It is generally a good idea to include in the project what is considered to be all of the poject code. Regardess of vMicro source control and intellisense would require it. |
Title: Re: Local Files Override Library Files not being honored? Post by FrankP on Mar 26th, 2020 at 5:40pm
I used the 'Show all Files' option to display all the files for both the 'Mod1' and 'Mod2' projects. As the attached images show, the two project setups are identical (at least as far as files, I guess), and both locally held I2C_Anything.h files are identical.
So, then I renamed the VMBuilds folder for Mod1 (so that it would be regenerated from scratch) and tried to compile Mod1 again - same errors as before, but now I see that there is a SBWire folder in the VMbuilds folder for Mod1 that isn't in Mod2. So it appears that somehow the Mod1 project is still insisting on using the version of I2C_Anything that references SBWire, and this is what is causing the compile for Mod1 to fail. Any ideas what is causing this? Frank https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=2020-03-26_12-29-23.zip ( 1026 KB | 8
Downloads )
|
Title: Re: Local Files Override Library Files not being honored? Post by FrankP on Mar 26th, 2020 at 6:02pm
Tim,
BTW, I was also able to confirm that both the Mod1 & Mod2 projects are actually compiling their local copies of I2C_Anything.h. To do this I made an obviously non-compiling edit to each project's local version of I2C_Anything.h and confirmed that subsequent compiles failed at the edit point. Then I removed the edit error and both projects now compiled past the point of the error. However, the Mod2 project compiles to completion (as before) while the Mod1 project compile still dies with bunches of SBWire-generated errors. Frank |
Title: Re: Local Files Override Library Files not being honored? Post by Visual Micro on Mar 26th, 2020 at 8:39pm
click build > clean solution on both. then build both and capture the output with the settings in yellow above enabled. also submit your code because it is not clear what code you have were. I suggest also deleting the __vm folder below each project then reopening the project (s)
|
Title: Re: Local Files Override Library Files not being honored? Post by FrankP on Mar 27th, 2020 at 3:18pm
Tim,
Attached. Thank you for looking at this, and please let me know if there is anything else you need. I'm sure its just something stupid that I'm doing, but I sure can't figure it out! ;-). Frank https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=200327_LocalFileProblem.zip ( 16 KB | 10
Downloads )
|
Title: Re: Local Files Override Library Files not being honored? Post by Visual Micro on Mar 27th, 2020 at 4:18pm
please zip the entire project folder with all sources. just the .ino file doesn't really show what we need
|
Title: Re: Local Files Override Library Files not being honored? Post by FrankP on Mar 27th, 2020 at 6:09pm
Tim,
here you go ;-) Frank https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=I2C_Master_Tut_Mod1_2.zip ( 706 KB | 8
Downloads )
|
Title: Re: Local Files Override Library Files not being honored? Post by Visual Micro on Mar 27th, 2020 at 6:20pm
In one source code you #include using <> in the other you use "".
Code 1 - #include <I2C_Anything.h> Code (c++):
Code 2 - #include "I2C_Anything.h" Code (c++):
|
Title: Re: Local Files Override Library Files not being honored? Post by FrankP on Mar 27th, 2020 at 7:13pm
Code 1 - #include <I2C_Anything.h>
Code 2 - #include "I2C_Anything.h" Well, that was embarrassing! That did he trick. Thanks for taking the time from your full-time job of supporting Visual Micro to teach me basic programming ;-) Frank |
VS Arduino » Powered by YaBB 2.6.12! YaBB Forum Software © 2000-2024. All Rights Reserved. |