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 Shared code projects/files (Read 2915 times)
Hedde
Newbies
*
Offline


Posts: 5
Joined: Feb 3rd, 2016
Shared code projects/files
Feb 3rd, 2016 at 9:15pm
Print Post  
I like to share code between Win32 and Arduino projects. In Visual Studio files can be shared by including 'existing files' in a project. However these do not work in Arduino projects.
Is a best practice known for sharing multiple files between multiple projects, both Arduino and Win32?
(I am using symbolic links for the time being, which is very time consuming.)
Regards,
Hedde
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Shared code projects/files
Reply #1 - Feb 3rd, 2016 at 9:40pm
Print Post  
Hi,

There is some support for shared files but it is a new feature and maybe some improvements would help Smiley

You do need to add your own includes to the Visual Micro "Project Properties>extra flags" (or other property)

This example looks for .h files exist in two different shared folders

Code
Select All
-I"C:\Users\me\Documents\SharedSources1" -I"C:\Users\me\Documents\SharedSources2"  



If you need .o files to be produced then you must ensure that you have used "Add existing" to include the .c, .cpp or .s files.

more

If you require a .a archive then, if practical, consider moving your shared code into the \src folder (and sub folders) of a new Arduino library. Then use the library.properties text file to specify "dot_a_linkage=true"

« Last Edit: Feb 3rd, 2016 at 9:42pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Hedde
Newbies
*
Offline


Posts: 5
Joined: Feb 3rd, 2016
Re: Shared code projects/files
Reply #2 - Feb 7th, 2016 at 9:29am
Print Post  
Hi Tim,

This was exactly what I needed!

Regards,

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