title: Static linking, boost::locale
body: <p>Due to various non-compatible with each other boost library versions on different systems. I need to link statically program that uses boost::locale.</p>
  
  <p>But I fail to it because of the boost::locale::generator.</p>
  
  <pre><code>// simple example - static_locate.cpp 
  #include &lt;boost/locale.hpp&gt;
  
  int main () {
      boost::locale::generator gen;
      return 0;
  }
  </code></pre>
  
  <p>g++ build:</p>
  
  <pre><code>$ g++          staic_locale.cpp -lboost_system -lboost_locale || works
  $ g++ --static staic_locale.cpp -lboost_system -lboost_locale &amp;&amp; a lot of linking errors
  </code></pre>
  
  <p>Refering to <a href="https://stackoverflow.com/questions/2348200/trying-to-statically-link-boost">Trying to statically link Boost</a>. Adding <code>-pthread</code> and/or <code>-lboost_thread</code> a little bit helps, but still not completely.</p>
  
  <p><a href="http://nopaste.linux-dev.org/?1120099" rel="nofollow noreferrer">build log (nopaste)</a></p>
  
  <p>system:</p>
  
  <pre><code>$ cat /etc/os-release 
  NAME="Ubuntu"
  VERSION="15.10 (Wily Werewolf)"
  </code></pre>
  
  <p>boost version:</p>
  
  <pre><code>$ apt-cache policy libboost-dev 
  libboost-dev:
    Installed: 1.58.0.0ubuntu1
  </code></pre>