VS Arduino
>> >> Ignore files marked as excluded from project
https://www.visualmicro.com/forums/YaBB.pl?num=1496509620

Message started by scott on Jun 3rd, 2017 at 5:07pm

Title: Ignore files marked as excluded from project
Post by scott on Jun 3rd, 2017 at 5:07pm
Currently it seems that c/cpp files included in the project but marked as exclude from build still get compiled which causes mulitple definition linker errors in the same files are library files also used in the project.
E.G. I inlcude stepper.c in the project and set to not build and the project uses the stepper library.

I normally have the c/cpp from the libraries I'm using in the project for ease of reference (set to not include in build), which is currently causing link errors.

Title: Re: Ignore files marked as excluded from project
Post by Visual Micro on Jun 3rd, 2017 at 5:11pm
There is a tool options setting that might disable that feature but if you tried to compile the files in the arduino ide is would probably get confused. It's best not to put them in the project folder.

There is a better way to work. Either use "vmicro>toggle hidden files" (if it doesn't crash due to vs bugs which ms is investigating) or use the checkbox on the "add library" menu that "creates a project" for a library. The project allows you to see (and develop) the library sources as a real vs project.

http://www.visualmicro.com/post/2017/01/16/Arduino-Cross-Platform-Library-Development.aspx


Title: Re: Ignore files marked as excluded from project
Post by scott on Jun 4th, 2017 at 4:02pm
Thanks for the quick response Tim.
I dont think I explained my setup that well. The folder structure on windows is as the normal arduino setup, e.g. project folder and libraries etc with the added VisualStudio visualMicro project.

ProjectTopLevel
...VsProjectSolution.sln
...VsProjectFolder
.......Project.ino
.......Project.vcxproj etc
...libraries
.......libraryX

I was adding the files from the ..\libraries\libraryX\... to the project so I could edit the library and build my project from the same VS project. I had set the C/Cpp file not to build but they got build anyway.
The setup above maintains the arduino compatibility but allow me to edit the library in use and build my project at the same time.

Your link sounds great, just what I'm looking for, however I'm using VS2013. Stuck with that build environment for now I'm afraid.

I tried your other option of setting the:
Tools/options/VisualMicro/Compatibility/Compile Files In Project
as false, this worked a treat with the C/Cpp files set as not in project build. I did look at the project options but forgot to look in those options.

Thanks for the help. Visual Micro is a great tool, I frequently recommend it to my friends and colleagues and I'd recommend it to anyone who builds arduino and AVR projects. Great support too as always! :D :)

Cheers.

Title: Re: Ignore files marked as excluded from project
Post by Visual Micro on Jun 4th, 2017 at 4:09pm
Thanks very much for the support.

Yes I will look into that. In fact what needs to happen is regardless of if files are included in the project.

If they are included in the project but not discovered during deep search then they should still be ignored.

The "vmicro>toggle hidden files" in vs2013 is the best option for now. Then you can see your library sources linked under a folder called "src\_micro-api-readonly\libraries". The files are ignored during compile but remember that I used the word "LINKED". Visual micro does not copy the library sources to the project, is used links/shortcuts. This gives the live source code view inside your project without interfering with compile.

Or you can create "solution folders" outside of the project and add linked source to them.

Title: Re: Ignore files marked as excluded from project
Post by smithassignment1 on Jul 4th, 2018 at 5:01am
Hey, my name is Jonathan and I am a newbie here. You can exclude these files as they do not have any use.

Title: Re: Ignore files marked as excluded from project
Post by Visual Micro on Jul 4th, 2018 at 12:09pm
Hi, please create your own new threads when asking questions in this forum.

The answer is to switch OFF/False "tools>options>visual micro>compatibility>compile ALL project folder sources"

Remember: When you work this way the Arduino IDE will not like it so you need to delete files before using Arduino IDE in the future.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.