title: Interop with native libraries in linux
body: <p>I am writing an application in C#, which is cross platform. It uses <code>DllImport</code> for several different libraries. It is also both x32 and x64.
  It seems to work right for my own compiled .dll/.so. I put the x32 shared libraries in the x32 sub-folder, and the x64 shared libraries in the x64 sub-folder.</p>
  
  <p>On windows via .net framework I call <code>SetDllDirectory("x32" or "x64")</code> depending on the current 
  runtime. On mono, either through windows, linux or mac, I use a <code>DllMap</code>, in RandomLibrary.dll.config. It works fine for files that are located in the x32 or x64 directories.</p>
  
  <p>However, I also use <code>DllImport</code> for libraries that I didn't write, such as FreeType2. On windows, I just shove the built libraries in the two sub-folders. However on linux I would rather use the libfreetype6 library that you can install via your friendly local package manager. I can hardcode the DllMap link to <code>/usr/lib/x86_64-linux-gnu/libfreetype</code>.so.6, but I assume that the freetype file will change depending on what distro you use. </p>
  
  <p>Is there any easy way where it can just find libfreetype.so regardless of what distro I am using?</p>