title: linking to boost libraries fails during compilation
body: <p>I have a very simple example program that I am trying to compile, but I'm getting linking errors.</p>
  
  <h2>Program</h2>
  
  <pre><code>int main()
  {
    boost::asio::io_service io;
  
    boost::asio::deadline_timer t(io, boost::posix_time::seconds(5));
    t.wait();
  
    std::cout &lt;&lt; "Hello, world!\n";
  
    return 0;
  }
  </code></pre>
  
  <h2>Compilation</h2>
  
  <p>I'm using the following compile options:</p>
  
  <pre><code>g++ -L/usr/lib -lboost_system -lboost_filesystem -lboost_thread -pthread -I/usr/include timer.cpp -o timer
  </code></pre>
  
  <h2>Output</h2>
  
  <p>I've checked that the dynamic libraries exist and are located in the -L path. Here are the errors I'm getting:</p>
  
  <pre><code>/tmp/cc3hJrVk.o: In function `__static_initialization_and_destruction_0(int, int)':
  timer.cpp:(.text+0xf0): undefined reference to `boost::system::generic_category()'
  timer.cpp:(.text+0xfc): undefined reference to `boost::system::generic_category()'
  timer.cpp:(.text+0x108): undefined reference to `boost::system::system_category()'
  /tmp/cc3hJrVk.o: In function `boost::system::error_code::error_code()':
  timer.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17): undefined reference to `boost::system::system_category()'
  /tmp/cc3hJrVk.o: In function `boost::asio::error::get_system_category()':
  timer.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[boost::asio::error::get_system_category()]+0x5): undefined reference to `boost::system::system_category()'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>As you can see, it seems like the bugs are something you'd get if you're improperly linking to libboost_system. I have two separate installs of boost that I've tested against, and I'm at my wit's end.</p>
  
  <p>Thanks in advance for any help!</p>