title: dlopen works but dlsym doesn't
body: <p>I'm loading a <code>so</code> library on Linux using the following snippet:</p>
  
  <pre><code>handle = dlopen("myLib.so", RTLD_LAZY);
  if(handle == NULL) {
    throw std::runtime_error("unable to load myLib.so");
  }
  </code></pre>
  
  <p>Further down I then try to access a method in the <code>so</code>:</p>
  
  <pre><code>getter = dlsym(handle, "getMethod");
  if(getter == 0) {
    std::ostringstream msg;
    msg &lt;&lt; "missing entry point " &lt;&lt; dlerror();
    throw std::runtime_error(msg.str().c_str());
  }
  </code></pre>
  
  <p>When running this, there is no exception at the <code>dlopen</code> stage, but I keep getting the error:</p>
  
  <p><code>missing entry point undefined symbol: getMethod</code></p>
  
  <p>Running <code>nm</code> on <code>myLib.so</code> shows the <code>getMethod</code>:</p>
  
  <pre><code>&gt; nm myLib.so | grep get
  
  0000000000024220 T getMethod
  </code></pre>
  
  <p>I want and I'm also using <code>extern "C"</code> on that method as well.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I'm suspecting now that although the NULL check of the handle doesn't cause an exception, there may be an issue with the handle itself.</p>
  
  <p>Is there anyway I can perform any further checks on the handle other than just == NULL, to confirm the call the dlopen was successful?</p>