title: How to check shared library version in the binary
body: <p>I have a program that is linked with some shared library on start. There are multiple versions of the library installed on the host. Is there some function or macro that can check the version of library that was linked to my program? I want something like this:</p>
  
  <pre><code>int main() {
      REQUIRE_LIBRARY_VERSION_GREATER("libgcc", 1, 2, 3); //example
  }
  </code></pre>
  
  <p>Is it possible in unix? I need it at least on linux and freebsd.</p>
  
  <p>EDIT: I would prefer to avoid fork/exec if possible.</p>