Search code examples
c++dlopenshared-objects

Error on dlopen: St9bad_alloc


I have some c++ code I'm using for testing in which the first line is a call to dlopen in an attempt to load my shared object. Upon hitting this line I get the following error:

Terminate called after throwing an instance of std::bad_alloc: 
   what() : St9bad_alloc

I've upped the memory (free -m now reports that I have ~120 MB free when my exe is loaded in gdb) and I still get the same message.

Anyone any ideas on what else could be causing this & what I can do to resolve it?


Solution

  • Take a look at the C++ dlopen mini HOWTO, hope that helps.