title: g++ compile error .h file
body: <p>I'm trying to compile a .cpp file using g++ in Linux Ubuntu 10.10 and when i try to compile this code </p>
  
  <pre><code>#include &lt;iostream&gt;                                                             
  #include &lt;vector&gt;                                                               
  #include &lt;"writeVector.h"                                                       
  #include &lt;"insertionSort.h"&gt;                                                    
  using namespace std;  
  
  
  
  int main()                                                                      
  {                                                                               
    int n;                                                                        
    int i;                                                                        
    vector&lt;int&gt; V;                                                                
    cout &lt;&lt; "Enter the amount of numbers you want to evaluate: ";                 
    cin &gt;&gt; n;                                                                     
    cout &lt;&lt; "Enter your numbers to be evaluated: " &lt;&lt; endl;                       
    while (V.size() &lt; n &amp;&amp; cin &gt;&gt; i){                                             
     V.push_back(i);                                                              
    }   
  
    InsertionSort(V);                                                             
    write_vector(V);                                                              
    return 0;                                                                     
  }   
  </code></pre>
  
  <p>I have both .h files in the same folder but it keeps saying that my <code>writeVector.h</code> file or folder does not exist.</p>
  
  <p>This is what my <code>writeVector.h</code> file looks like</p>
  
  <pre><code>#include &lt;iostream&gt;                                                             
  #include &lt;vector&gt;                                                               
  using namespace std;                                                            
  
  template &lt;typename T&gt;                                                          
  
  void write_vector(const vector&lt;T&gt;&amp; V)                                          
  
  {                                                  
  
    cout &lt;&lt; "The numbers in the vector are: " &lt;&lt; endl;                            
    for(int i=0; i &lt; V.size(); i++)                                                                                                                             
      cout &lt;&lt; V[i] &lt;&lt; " ";                                                       
  
  }       
  </code></pre>
  
  <p><code>insertionSort.h</code> file</p>
  
  <pre><code>#include &lt;iostream&gt;                                                             
  #include &lt;vector&gt;                                                               
  using namespace std;                                                            
  
  void InsertionSort(vector&lt;int&gt; &amp;num)                                            
  {                                                                               
       int i, j, key, numLength = num.length( );                                  
       for(j = 1; j &lt; numLength; j++)    // Start with 1 (not 0)                  
      {                                                                           
             key = num[j];                                                        
             for(i = j - 1; (i &gt;= 0) &amp;&amp; (num[i] &lt; key); i--)   // Smaller values move up                                                                         
            {                                                                     
                   num[i+1] = num[i];                                             
            }                                                                     
           num[i+1] = key;    //Put key into its proper location                  
       }                                                                          
       return;                                                                    
  }
  </code></pre>