title: g++ using a object file in external directory
body: <p><strong>Context:</strong></p>
  
  <p>I am current learning c/c++ compiling on my raspberry pi b+ model (started last week), but having trouble using a header file inside a object file.</p>
  
  <hr>
  
  <p><strong>File locations:</strong></p>
  
  <p>main.cpp      - ~/src/c++/projects/web_server</p>
  
  <p>http_socket.o - ~/src/c++/web</p>
  
  <hr>
  
  <p><strong>g++ output for <code>g++ -o webserver ~/src/c++/web/http_socket.o -std=c++0x main.cpp</code></strong></p>
  
  <p>main.cpp:3:25: fatal error: http_socket.h: No such file or directory
  compilation terminated.</p>
  
  <hr>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include "http_socket.h"
  
  int main() { return 0; }
  </code></pre>
  
  <p><strong>http_socket.cpp</strong></p>
  
  <pre><code>#include "http_socket.h"
  #include &lt;string&gt;
  
  using namespace std;
  
  http_responce::http_responce(string status_Code, string date, string server, string content_Type, string content_Length) {
  Status_Code = status_Code;
  Date = date;
  Server = server;
  Content_Type = content_Type;
  Content_Length = content_Length;
  }
  </code></pre>
  
  <p><strong>http_socket.h</strong></p>
  
  <pre><code>#ifndef HTTP_SOCKET_H
  #define HTTP_SOCKET_H
  
  #include &lt;string&gt;
  
  using namespace std;
  
  class http_responce 
  {
      public:
      string Status_Code;
      string Date;
      string Server;
      string Content_Type;
      string Content_Length;
  
      http_responce(string status_Code, string date, string server, string content_Type, string content_Length);
  
      private:
  
      protected:
  };
  
  #endif
  </code></pre>
  
  <hr>
  
  <p><strong>Addition note:</strong></p>
  
  <p>I am very new to this language and accustomed to using an IDE, so please forgive me if it is something very trivial that I have missed.</p>