title: gcc-4.9 cannot compile #include "user defined file"
body: <p>I try to compile the following simple c++ file(a.cpp) with gcc-4.9.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;foo&gt;
  
  using namespace std;
  
  int main()
  {
    int x = 3;
    cout &lt;&lt; f(x) &lt;&lt; endl;
    return 0;
  }
  </code></pre>
  
  <p>"foo" is also the following simple c++ file (remove include guard  to make code more simple).</p>
  
  <pre><code>int f(int ret){
      return ret + 1;
  }
  </code></pre>
  
  <p>I cannot compile a.cpp with gcc-4.9 because the compiler say:</p>
  
  <pre><code>a.cpp:2:15: fatal error: foo: No such file or directory
  </code></pre>
  
  <p>I think the compile error is caused because the user defined file is included as standard header file (put parentheses around, "&lt;***>").</p>
  
  <p>Before, I see the same error and know two methods to solve these compile errors.</p>
  
  <p>First one is changing compiler gcc-4.9 to gcc-5.0.</p>
  
  <p>Second one is replacing</p>
  
  <pre><code>#include &lt;foo&gt;
  </code></pre>
  
  <p>with</p>
  
  <pre><code>#include "foo"
  </code></pre>
  
  <p>.</p>
  
  <p>Although I don't know why compile error is solved by theses methods, I do it since now.</p>
  
  <p>But now, I see a code that cannot be solved by a second method.
  It includes many user defined file as standard file in many header file. So, by second method, we must edit the many header files.</p>
  
  <p>Also it is solved by first method, but I wan to compile with gcc-4.9 now.
  I think If there exists a method to compile "a.cpp" by gcc-4.9 without editing, the codes can be compiled by the same method.</p>
  
  <p>How can I compile "a.cpp" by gcc-4.9 without editing. And why I can compile "a.cpp" by gcc-5.0?</p>