title: Cannot dlopen a shared library from a shared library, only from executables
body: <p>I have a C++ CMake project that has multiple sub-projects that I package into shared libraries. Then, the project itself, which is an executable, links with all these shared libraries. This is a project that is being ported from Windows to Ubuntu. What I do is have the exectable, EXE, use a one subproject, Core, to open all other libraries. Problem is that this isn't working on Linux. </p>
  
  <p>This is EXE:</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      core::plugin::PluginManager&amp; wPluginManager = core::plugin::PluginManagerSingleton::Instance();
      wPluginManager.loadPlugin("libcore.so");
      wPluginManager.loadPlugin("libcontroller.so")
      wPluginManager.loadPlugin("libos.so")
      wPluginManager.loadPlugin("libnetwork.so")
      wPluginManager.loadPlugin("liblogger.so")
  }
  </code></pre>
  
  <p>This is <code>core::plugin::PluginManager::loadPlugin()</code>:</p>
  
  <pre><code>bool PluginManager::loadPlugin(const boost::filesystem::path &amp;iPlugin) {
      void* plugin_file = dlopen(plugin_file_name, RTLD_LAZY);
      std::cout &lt;&lt; (plugin_file ? " success" : "failed") &lt;&lt; std::endl;
      return true;
  }
  </code></pre>
  
  <p>What happens is that libcore gets loaded properly, but then all other libraries fail with no no error message. I cannot find out why it's not working. However, when I do the same thing, but instead of having Core load the libraries, I simply do it in main and it works. </p>
  
  <p>Basically, I can load libraries from an <code>exe</code>, but I can't from other shared libraries. What gives and how can I fix this?</p>