title: linking a library to an android ndk application in visual studio 2015
body: <p>I've created a Native-Activity Application for Android in Visual Studio 2015. If I just run the example code, the app works. I want to use and external library in my app though. For this, I do the following:</p>
  
  <ol>
  <li>Add the include dir to C/C++->General->Additional Include Directories</li>
  <li>Add the lib/x86 path to Linker->General->Additional Library Directories</li>
  <li>Add the library name to Linker->Input->Library Dependencies</li>
  </ol>
  
  <p>With these settings I can use some library code in my project and get it compiled. If, for example, I should omit the library directory, the compiler complains about the unimplemented functions.</p>
  
  <p>But if I run the generated apk on the emulator or android phone, it crashes instantly, even before any breakpoint is hit.</p>
  
  <p>Even when I don't actually use the library (comment out all my own code), but just link it, the app crashes.</p>
  
  <p>One clue I have is that, even while the library is used to compile the app, it is not copied into the apk file. I've unpacked the apk and it includes 2 files in lib\x86: gdbserver and libAndroid1.so (which is the compiled version of my native activity). But the library I linked is just not there.</p>
  
  <p>I guess I am supposed to indicate somewhere in the project that I want my library included in the apk, but where do I do that?</p>