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 Custom include path (Read 3930 times)
Paul Martinsen
Junior Member
**
Offline


Posts: 14
Joined: Apr 12th, 2017
Custom include path
Apr 13th, 2017 at 3:54am
Print Post  
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: 14
Joined: Apr 12th, 2017
Re: Custom include path
Reply #1 - Apr 13th, 2017 at 4:44am
Print Post  
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: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Custom include path
Reply #2 - Apr 13th, 2017 at 11:12am
Print Post  
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
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint