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
Normal Topic How to solve "Ignoring source code ..." (Read 4072 times)
Bas
Junior Member
**
Offline


Posts: 50
Joined: Feb 20th, 2017
How to solve "Ignoring source code ..."
Jun 8th, 2017 at 8:17pm
Print Post  
When I want to add source code files to a shared project or library I cannot seem to do that from wiithin VS. All " Add.." commands are related to the default project, and a shared project cannot be set as default project.

So my workaround is to add the files to the main project, remove them from the project, move the physical files to the shared project folder and add them to the shared project.

This workaround works (hence the name workaround) but it does result in warnings like these:

Quote:
Ignoring source code that is included in the project but can not be located <filename>


where the <filename> is the path of the originally created source file.

My questions: 
  • Is there an easier way to add sourcefiles to a shared project?
  • If not, how can I solve or avoid the warning?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to solve "Ignoring source code ..."
Reply #1 - Jun 8th, 2017 at 8:55pm
Print Post  
Hi,

I'll ignore your workaround for now and discuss what options there are and you can tell me what doesn't work. I am assuming you are using vs2015 or vs2017

1)
You can add "short cuts" to individual code files to an arduino project by using "add existing" and selecting "add as link". These code files will be copied to the temp build folder when the arduino project is compiled so you must assume they are in the root of the arduino project from an #include point of view.

2) You can add a new Visual Studio Shared Code projects to the current solution using file>new>c++>misc>shared code project. The code of shared code projects is merged into the temp build folder during build and the directory structure is maintained. Therefore a file in "sharedproject1\test" will available to the main code in the root of the project as #include "test\foo.h"

3) Shared library projects are same as 2) except they will have an Arduino compatible library.properties text file in the root of the project. Then the shared project will be compiled as if it is a normal arduino library.

In both 2) and 3) you have to right click the "main" project "References" in the solution explorer and add a reference to any "Shared Project(s)" you want the main project to use.

Shared projects can not be started directly and do not have a fixed platform. The intellisense in shared projects is fed from the platform of the current "Startup project. Therefore switching the board of the startup project or switching the startup project to another Arduino project will cause the intellisense in shared project code to automatically changed.

The shared project system is a core part of Visual Studio you can also read about it in the VS help. All Visual Micro does is to ensure the shared project code is copied to and compiled below the temp build folder which is how Arduino is compiled.

There is more info here. 

Arduino-Cross-Platform-Library-Developmen
  
Back to top
WWW  
IP Logged
 
Bas
Junior Member
**
Offline


Posts: 50
Joined: Feb 20th, 2017
Re: How to solve "Ignoring source code ..."
Reply #2 - Jun 8th, 2017 at 9:02pm
Print Post  
Thanks for your reply, but I think you missed my point here.

The situation is as follows:

I have a solution with a main (startup) project, and several Shared Code projects.
Now I want to add a skeleton .cpp and .h file to one of the SharedCode projects.
When I rightclick on a SharedCode project, select Add / Empty Arduino .cpp plus header, and enter a name then the new files are saved in the source folder of the the main (startup) project, and the files are added to the main (startup) project.
And not to the SharedCode project I started the action with the rightclick on.

So my questions are only about managing source files of the different projects (.vxitems files if you wish), and not about how sharedprojects are included in the main project during building
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to solve "Ignoring source code ..."
Reply #3 - Jun 8th, 2017 at 9:09pm
Print Post  
Oh sorry.

For shared code projects use the standard visual studio commands such as "Add>New Item"

Bugs in VS prevent Visual Micro from adding code so those menu items will be removed if MS don't fix it soon Smiley

Anyway shared code projects are standard vs projects so please use the standard vs commands.

Thanks
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint