title: C++ Boost: undefined reference to `boost::system::detail::system_category_ncx()`
body: <p>I am trying to use Microsoft REST SDK to create a server listening to HTTP requests. My current computer is Ubuntu 18.04, the server code is pretty simple.</p>
  
  <p>I have already installed the library by following the instructions on <a href="https://www.boost.org/users/history/version_1_68_0.html" rel="nofollow noreferrer">libboost official website</a> and I have checked files in <code>/usr/local/lib/</code>, there are <code>libboost_random.so.1.68.0</code> so I presume that I have libboost library.</p>
  
  <p>However when I try to compile the code with the following command:</p>
  
  <p><code>g++ server.cpp -o server -lpthread -lcpprest -lcrypto -lssl -lboost_system</code></p>
  
  <p>It shows:</p>
  
  <pre><code>/tmp/ccKWADuo.o: In function `boost::system::system_category()':
  server.cpp:(.text._ZN5boost6system15system_categoryEv[_ZN5boost6system15system_categoryEv]+0x7): undefined reference to `boost::system::detail::system_category_instance'
  /tmp/ccKWADuo.o: In function `boost::system::generic_category()':
  server.cpp:(.text._ZN5boost6system16generic_categoryEv[_ZN5boost6system16generic_categoryEv]+0x7): undefined reference to `boost::system::detail::generic_category_instance'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Thanks for any advices.</p>