title: G++ cannot find boost library
body: <p>I am not good in command-line compiling. My problem is inability to compile simple project, that depends from Boost. The following is a log of my trying:</p>
  
  <pre><code>$ g++ -Wall test.cpp -o main
  /tmp/ccCTvBYE.o: In function `__static_initialization_and_destruction_0(int, int)':
  test.cpp:(.text+0x6b): undefined reference to `boost::system::generic_category()'
  test.cpp:(.text+0x77): undefined reference to `boost::system::generic_category()'
  test.cpp:(.text+0x83): undefined reference to `boost::system::system_category()'
  /tmp/ccCTvBYE.o: In function `boost::asio::error::get_system_category()':
  test.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5): undefined reference to `boost::system::system_category()'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>So, <a href="https://stackoverflow.com/questions/13467072/c-boost-undefined-reference-to-boostsystemgeneric-category">there</a> I found instructions for adding<code>-lboost_system</code> or <code>-lboost_system-mt</code>. I got the following:</p>
  
  <pre><code>$ g++ -lboost_system -Wall test.cpp -o main                                                                                                                    
  /usr/bin/ld: cannot find -lboost_system
  collect2: error: ld returned 1 exit status
  
  $ g++ -lboost_system-mt -Wall test.cpp -o main                                                                                                                 
  /usr/bin/ld: cannot find -lboost_system-mt
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>I tried to locate <code>boost_system</code> library.</p>
  
  <pre><code>$ /sbin/ldconfig -p | grep boost_system
      libboost_system.so.1.53.0 (libc6,x86-64) =&gt; /usr/lib/x86_64-linux-gnu/libboost_system.so.1.53.0
  </code></pre>
  
  <p>Then I unsuccessfully tried the following</p>
  
  <pre><code>$ g++ -I"/home/third_party/boost/" -L"/usr/lib/x86_64-linux-gnu/" -lboost_system -Wall test.cpp -o main
  /usr/bin/ld: cannot find -lboost_system
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Now I am stuck. How to form the command to compile?</p>
  
  <p><strong><em>Edit:</em></strong></p>
  
  <p>The following trying didn't help, too.</p>
  
  <pre><code>ln -s /usr/lib/x86_64-linux-gnu/libboost_system.so.1.53.0 /usr/lib/x86_64-linux-gnu/libboost_system.so
  ldconfig -n /usr/lib/x86_64-linux-gnu/
  
  $ ll /usr/lib/x86_64-linux-gnu/ | grep boost_system
  lrwxrwxrwx   1 root root       51 янв.  21 19:47 libboost_system.so -&gt; /usr/lib/x86_64-linux-gnu/libboost_system.so.1.53.0
  -rw-r--r--   1 root root    14536 окт.  13 07:14 libboost_system.so.1.53.0
  
  $ g++ -I"/home/third_party/boost/" -L"/usr/lib/x86_64-linux-gnu/" -lboost_system -Wall -m64 boost_async.cpp -o main
  /tmp/ccE20K2W.o: In function `__static_initialization_and_destruction_0(int, int)':
  test.cpp:(.text+0x6b): undefined reference to `boost::system::generic_category()'
  test.cpp:(.text+0x77): undefined reference to `boost::system::generic_category()'
  test.cpp:(.text+0x83): undefined reference to `boost::system::system_category()'
  /tmp/ccE20K2W.o: In function `boost::asio::error::get_system_category()':
  test.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5): undefined reference to `boost::system::system_category()'
  collect2: error: ld returned 1 exit status
  </code></pre>