title: How to tell g++ compiler where to search for include files?
body: <p>In a "working directory" I have a lot of *.cpp and *.h files that <code>#include</code> each other and files from subdirectories.</p>
  
  <p>For example:</p>
  
  <pre><code>#include "first.h"
  #include "second.h"
  #include "dir1/third.h"
  #include "dir2/fourth.h"
  </code></pre>
  
  <p>In my own directory (that is different from the "working" directory) I would like to create a new *.cpp and *.h file that includes one of the files from the "working" directory. For example:</p>
  
  <pre><code>#include "/root/workingdirectory/first.h"
  </code></pre>
  
  <p>However, it does not work. Because "first.h" might include "second.h" and "second.h" is not located in my directory. Is there a way to tell the compiler that it needs to search included files not in the current but in the working directory: <code>/root/workingdirectory/</code>?</p>
  
  <p>To make it even more complex, <code>dir1</code> and <code>dir2</code> are not located in my working directory. They are located in <code>/root/workingdirectory2/</code>. So, my second question is if it is possible to resolve this problem by letting compiler know that subdirectories are located somewhere else?</p>
  
  <p>I also need to add, that I do not use any environment for development and compile from the command line (using <code>g++</code>).</p>