title: How to create native C++ library on Android?
body: <p>I need to write a dynamic link library in C++ that is used by Java on Android.
  As I get, it should be .so library, but I don't know how to do that.
  I tried Cygwin, but it crashes:</p>
  
  <blockquote>
    <p>$ gcc 1.cpp</p>
    
    <p>/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: cannot find  -luser32 collect2: ld
    returned 1 exit status</p>
  </blockquote>
  
  <pre><code>1.cpp:
  int main(int, char**)
  {
     return 0;
  }
  </code></pre>
  
  <p>Can anyone help me with that?</p>
  
  <p><strong>P.S.</strong> I'm not good at *nix, so it should be better done under Windows</p>
  
  <p><strong>UPD:</strong> I've installed both Android NDK and Cygwin and added them to PATH environment variable</p>
  
  <p><strong>UPD2</strong>: Thanks for helping. The problem was with Cygwin itself. Reinstalling it and NDK solved the problem.</p>