I have an existing non-Arduino project with the following folder structure:
Top Level
-> SharedCode
-> SharedCode2
-> PortForMicrocontrollerXXX
-> PortForMicrocontrollerYYY
-> PortForArduino
I am working in the 'PortForArduino' folder so this is where my VS2017 project file is. I need to include in the compile the shared code in the tree.
Because this is an existing project I can't make copies of the shared code or move it.
I don't care about compatibility with the Arduino IDE.
If I understand it right I can't create an Arduino library because I would have to put Arduino-specific files into the top level folder, which I can't do because no code resides there and it would break the folder hierarchy.
In the VM project properties under Extra Flags I have added:
-I . -I ../SharedCode -I ../SharedCode2
I understand this does not compile the code - fine.
I have added the shared code source files to the VS project.
In this post:
http://www.visualmicro.com/forums/YaBB.pl?num=1455641592/16#16 and this one:
http://www.visualmicro.com/forums/YaBB.pl?num=1455641592/14#14 you mention using shortcuts to bring in external code that is outside of the VS2017 project folder.
In VS2017 I right-click on my project, choose Add -> Existing Item... and choose a file but the Add button in the dialog does not have the drop-down option to add as a link. Seems that is only available for managed projects, e.g. .NET.
In one of the posts I referenced above you said:
Quote:right click folder>add existing>link
Where is this - in Windows Explorer? VS2017?
The compilation error I get is:
Fatal error: foo.h: No such file or directory
foo.h is located in PortForArduino. It is included in a .c file in SharedCode.
Do you have any hints or suggestions for achieving what I want to do while respecting and maintaining my existing folder structure? Thanks!