title: Error when static linking g++
body: <p>I have a problem, i want to compile my application with static linking of mysql connector.</p>
  
  <p>My command line:</p>
  
  <blockquote>
    <p>g++  -o newserver  stdafx.cpp ... -lboost_system -lboost_thread
    -lpthread -lmysqlcppconn -static /usr/lib/libmysqlcppconn-static.a -std=c++0x</p>
  </blockquote>
  
  <p>But i have error:</p>
  
  <pre><code>/usr/bin/ld: cannot find -lmysqlcppconn
  /tmp/ccxpOfdZ.o: In function `IsEqualsDns(unsigned long, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;)':
  Server.cpp:(.text+0x356e): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>How can i fix this? 
  Thanks!</p>