Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Custom include path (Read 2951 times)
Paul Martinsen
Junior Member
**
Offline



Posts: 13
Custom include path
Apr 13th, 2017 at 4:54am
 
Hello,

Is it possible to add additional directories to the complier's search path? Either through -I or -iquote command line variables?

I'm trying to make this work:
Solution
+ Shared Project
++ ComplierDefinitions
+++ Definitions.h
+ Arduino Project
+ CLR Project
++ ComplierDefinitions
+++ Definitions.h


Various files in the Shared Project and Arduino Project do
#include "Definitions.h"

For the Arduino Project I want this to reference the one in Shared Project/Compiler Definitions; for the CLR Project I want it to reference the one in CLR Project/CompilerDefinitions

So I hoped I could add $(ProjectDir)CompilerDefintions to the include path property for the Arduino Project and CLR Project projects.

I tried adding $(ProjectDir)CompilerDefinitions to my Arduino Project but that doesn't seem to do it (I see the avr-g++ call in the output window when building Arduino Project but it doesn't include my extra folder).

Kind regards
Paul.
Back to top
 
 
IP Logged
 
Paul Martinsen
Junior Member
**
Offline



Posts: 13
Re: Custom include path
Reply #1 - Apr 13th, 2017 at 5:44am
 
I should have looked a little longer. For anyone else who has this problem...

I found you can access Visual Micro project properties in the Properties window (view -> properties window) rather than the Project Properties dialog.

There is a "Extra cpp flags" property, which get appended the the gcc call.

Visual Micro doesn't use MS Build properties but defines a bunch of its own including build.path. So I solved my problem by adding:
-I"{build.path}" -I"{build.path}\CompilerDefinitions"
to "Extra cpp flags".



Back to top
 
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11149
United Kingdom
Re: Custom include path
Reply #2 - Apr 13th, 2017 at 12:12pm
 
Thanks for the update. Yes the extra flags are a simple way to add paths.

Using Visual Studio shared projects can also be useful and make it easier to edit and see the code in the solution explorer.

Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print