title: visual c++ cross platform android: Include prebuilt shared library
body: <p>I'm using the Visual C++ Cross Platform Tools for Android as described here: <a href="https://msdn.microsoft.com/en-us/library/dn707591.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/dn707591.aspx</a></p>
  
  <p>Everything works fine so far (I can build and run on my phone the templates under File -> New Project -> Cross Platform -> Android). However, <strong>I can't find out how to link my app to a prebuilt shared library in the form of an *.so file</strong>.</p>
  
  <p>So far, I tried the following steps:</p>
  
  <p><strong>Step 1</strong></p>
  
  <p>To test the ability of Visual Studio to link to a prebuilt shared library, I created a small shared library as follows:</p>
  
  <p>SharedLibrary.cpp:</p>
  
  <pre><code>#include "SharedLibrary.h"
  
  const char * SharedLibrary::GetString()
  {
      return "Hello from Shared Library";
  }
  
  void SharedLibrary()
  {
  }
  
  SharedLibrary::SharedLibrary()
  {
  }
  
  SharedLibrary::~SharedLibrary()
  {
  }
  </code></pre>
  
  <p>SharedLibrary.h:</p>
  
  <pre><code>#pragma once
  
  class SharedLibrary
  {
  public:
      const char * GetString();
      SharedLibrary();
      ~SharedLibrary();
  };
  </code></pre>
  
  <p>Android.mk:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  LOCAL_MODULE := SharedLibrary
  LOCAL_SRC_FILES := SharedLibrary.cpp
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p><strong>Step 2</strong></p>
  
  <p>I then compiled this shared library using the command <em>ndk-build</em>, which gives me a file <em>libSharedLibrary.so</em></p>
  
  <p><strong>Step 3</strong></p>
  
  <p>I then created a Visual Studio project: File -> New -> Project -> Cross Platform -> Android -> Basic Application (Android, Ant). This project compiles and runs fine.</p>
  
  <p><strong>Step 4</strong></p>
  
  <p>The next step is where I am stuck: I need to somehow link the libSharedLibrary.so file to the Visual Studio project. I couldn't find anything in the project options of the Visual Studio project which allows me to do this. </p>
  
  <p>So, here is my question:
  How do I have to setup my Visual C++ cross platform Android project in order to link a shared object (*.so) to it?</p>
  
  <p>This is my first stackoverflow post, so feel free to correct me, if I did anything wrong in my post.</p>