title: Makefile error: boost/asio.hpp: No such file or directory (Windows)
body: <p>I have a C++ program, that compiles fine on Linux. But when I tried to compile it on Windows, I got: <code>fatal error: boost/asio.hpp: No such file or directory</code>.<br>
  I don't understand how is that possible, since I have few more boost includes (<code>&lt;boost/thread.hpp&gt;</code> and <code>&lt;boost/locale.hpp&gt;</code>) and they work fine. I also checked in my boost library, and <code>thread.hpp</code>, <code>locale.hpp</code> and <code>asio.hpp</code> are all there.<br>
  If that matters, on Linux I installed boost with the following commands (and it works there):                          </p>
  
  <pre><code>sudo apt-get install libboost-all-dev
  sudo apt-get install aptitude
  aptitude search boost                                         
  </code></pre>
  
  <p>And this is my code:                      </p>
  
  <p>Client.cpp:                               </p>
  
  <pre><code>#include "../include/ConnectionHandler.h"
  #include &lt;stdlib.h&gt;
  #include &lt;boost/thread.hpp&gt;
  #include &lt;boost/locale.hpp&gt;
  
   //A method used to read messages from the console (stdin) and send them to the server using a ConnectionHandler 
  void sendMessage(ConnectionHandler *connectionHandler){ // handles stdin
      if (connectionHandler-&gt;isConnected()){
          while (1){
              const short bufsize = 1024;
              char buf[bufsize];
              std::cin.getline(buf, bufsize);
              std::string line(buf);
              if (!connectionHandler-&gt;sendLine(line)) { break; }
              if (line=="QUIT"){
                  boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
                  if (!connectionHandler-&gt;isConnected()) { break; }
              }
          }
      }
  }
  
  //A method used to read messages from the socket (using the ConnectionHandler)
  void recieveMessage(ConnectionHandler *connectionHandler){ // handles socket
      while (1){
          std::string answer;
          if (!connectionHandler-&gt;getLine(answer)) {
              std::cout &lt;&lt; "Disconnected.\nExiting...\n" &lt;&lt; std::endl;
              break;
          }
          int len=answer.length();
          answer.resize(len-1);
          std::cout &lt;&lt; answer &lt;&lt; std::endl &lt;&lt; std::endl; // double line drops so it will be easier to notice between messages
          if (answer == "SYSMSG QUIT ACCEPTED") {
              std::cout &lt;&lt; "Disconnected.\nExiting...\n" &lt;&lt; std::endl;
              break;
          }
      }
      (*connectionHandler).close();
  }
  
  int main (int argc, char *argv[]) {
      if (argc &lt; 3) {
          std::cerr &lt;&lt; "Usage: " &lt;&lt; argv[0] &lt;&lt; " host port" &lt;&lt; std::endl &lt;&lt; std::endl;
          return -1;
      }
      std::string host = argv[1];
      unsigned short port_ = atoi(argv[2]);
      ConnectionHandler *connectionHandler_= new ConnectionHandler(host,port_);
      if (!(connectionHandler_)-&gt;connect()) {
          std::cerr &lt;&lt; "Cannot connect to " &lt;&lt; host &lt;&lt; ":" &lt;&lt; port_ &lt;&lt; std::endl;
          delete connectionHandler_;
          return 1;
      }
      boost::thread sender(&amp;sendMessage,connectionHandler_); // a different thread to handle stdin
      boost::thread reciever(&amp;recieveMessage,connectionHandler_); // a different thread to handle the socket
      reciever.join();
      sender.join();
      delete connectionHandler_;
  }
  </code></pre>
  
  <p>ConnectionHandler.h:                                          </p>
  
  <pre><code>#ifndef CONNECTION_HANDLER__
  #define CONNECTION_HANDLER__
  
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  #include &lt;boost/asio.hpp&gt;
  using boost::asio::ip::tcp;
  
  class ConnectionHandler {
  private:
      const std::string host_;
      const short port_;
      boost::asio::io_service io_service_;   // Provides core I/O functionality
      tcp::socket socket_;
      bool isConnected_;
  
  public:
      ConnectionHandler(std::string host, short port);
      virtual ~ConnectionHandler();
  
      bool connect();
      bool getBytes(char bytes[], unsigned int bytesToRead);
      bool sendBytes(const char bytes[], int bytesToWrite);
      bool getLine(std::string&amp; line);
      bool sendLine(std::string&amp; line);
      bool getFrameAscii(std::string&amp; frame, char delimiter);
      bool sendFrameAscii(const std::string&amp; frame, char delimiter);
      void close();
      bool isConnected();
  }; 
  
  #endif
  </code></pre>
  
  <p>ConnectionHandler.cpp:                                             </p>
  
  <pre><code>#include "../include/ConnectionHandler.h"
  
  using boost::asio::ip::tcp;
  using std::cin;
  using std::cout;
  using std::cerr;
  using std::endl;
  using std::string;
  
  ConnectionHandler::ConnectionHandler(string host, short port): host_(host), port_(port), io_service_(), socket_(io_service_), isConnected_(false){}
  
  ConnectionHandler::~ConnectionHandler() { close(); }
  
  bool ConnectionHandler::connect() {
      std::cout &lt;&lt; "Starting connect to " &lt;&lt; host_ &lt;&lt; ":" &lt;&lt; port_ &lt;&lt; std::endl;
      try {
          tcp::endpoint endpoint(boost::asio::ip::address::from_string(host_), port_); // the server endpoint
          boost::system::error_code error;
          socket_.connect(endpoint, error);
          if (error) { throw boost::system::system_error(error); }
          else{
              std::cout &lt;&lt; "Connection to " &lt;&lt; host_ &lt;&lt; ":" &lt;&lt; port_ &lt;&lt; " Successfully made!" &lt;&lt; std::endl;
              isConnected_ = true;
          }
      }
      catch (std::exception&amp; e) {
          std::cerr &lt;&lt; "Connection failed (Error: " &lt;&lt; e.what() &lt;&lt; ')' &lt;&lt; std::endl;
          return false;
      }
      return true;
  }
  
  bool ConnectionHandler::getBytes(char bytes[], unsigned int bytesToRead) {
      size_t tmp = 0;
      boost::system::error_code error;
      try {
          while (!error &amp;&amp; bytesToRead &gt; tmp ) {
              tmp += socket_.read_some(boost::asio::buffer(bytes+tmp, bytesToRead-tmp), error);
          }
          if(error) { throw boost::system::system_error(error); }
      } 
      catch (std::exception&amp; e) {
          std::cerr &lt;&lt; "recv failed (Error: " &lt;&lt; e.what() &lt;&lt; ')' &lt;&lt; std::endl;
          return false;
      }
      return true;
  }
  
  bool ConnectionHandler::sendBytes(const char bytes[], int bytesToWrite) {
      int tmp = 0;
      boost::system::error_code error;
      try {
          while (!error &amp;&amp; bytesToWrite &gt; tmp ) {
              tmp += socket_.write_some(boost::asio::buffer(bytes + tmp, bytesToWrite - tmp), error);
          }
          if(error) { throw boost::system::system_error(error); }
      } 
      catch (std::exception&amp; e) {
          std::cerr &lt;&lt; "recv failed (Error: " &lt;&lt; e.what() &lt;&lt; ')' &lt;&lt; std::endl;
          return false;
      }
      return true;
  }
  
  bool ConnectionHandler::getLine(std::string&amp; line) { return getFrameAscii(line, '\n'); }
  
  bool ConnectionHandler::sendLine(std::string&amp; line) { return sendFrameAscii(line, '\n'); }
  
  bool ConnectionHandler::getFrameAscii(std::string&amp; frame, char delimiter) {
      char ch;
      do{
          if(!getBytes(&amp;ch, 1)) { return false; }
          frame.append(1, ch);
      }while (delimiter != ch);
      return true;
  }
  
  bool ConnectionHandler::sendFrameAscii(const std::string&amp; frame, char delimiter) {
      bool result=sendBytes(frame.c_str(),frame.length());
      if(!result) return false;
      return sendBytes(&amp;delimiter,1);
  }
  
  // Close down the connection properly.
  void ConnectionHandler::close() {
      try{
          socket_.close();
          isConnected_ = false;
      } 
      catch (...) { std::cout &lt;&lt; "closing failed: connection already closed" &lt;&lt; std::endl; }
  }
  
  bool ConnectionHandler::isConnected(){ return isConnected_; }                   
  </code></pre>
  
  <p>makefile:                                    </p>
  
  <pre><code># All Targets
  all: client
  
  # Tool invocations
  # Executable "client" depends on the files Client.o, ConnectionHandler.o.
  client: bin/Client.o bin/ConnectionHandler.o
      @echo 'Building target: client'
      @echo 'Invoking: C++ Linker'
      g++ -o bin/client bin/Client.o bin/ConnectionHandler.o -lboost_system -lboost_locale -lboost_thread
      @echo 'Finished building target: client'
      @echo ' '
  
  # Depends on the source and header files
  bin/Client.o: src/Client.cpp
      g++ -g -Wall -c -Linclude -I/usr/local/boost/1.57.0/include/boost -o bin/Client.o src/Client.cpp
  
  # Depends on the source and header files 
  bin/ConnectionHandler.o: src/ConnectionHandler.cpp
      g++ -g -Wall -Weffc++ -c -Linclude -o bin/ConnectionHandler.o src/ConnectionHandler.cpp
  
  
  .PHONY: clean
  #Clean the build directory
  clean: 
      rm -f bin/*                    
  </code></pre>
  
  <p>How can I solve this error?</p>