# DynamicObject question

**URL:** <https://forum.juce.com/t/dynamicobject-question/7660>\
**Category:** General JUCE discussion\
**Created:** [November 4, 2011, 9:13pm UTC](https://forum.juce.com/t/dynamicobject-question/7660 "2011-11-04T21:13:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [November 4, 2011, 9:13pm UTC](https://forum.juce.com/t/dynamicobject-question/7660/1 "2011-11-04T21:13:10Z")

</div>

I’m wondering what the best way to load a dynamic library from a dynamic library (like a plugin) is?

I am vaguely aware that you can use code like this to load a DLL at runtime:

```auto
//for DLL runtime loading .... needed for plugins to load DLLs
#include <dlfcn.h>

 void* library = dlopen("/Users/aaronleese/Desktop/Livetronica Studio/libs/libDSPFiltersiOS.a", 0);
       
 dlsym(library, ...); // use the result in a call to dlsym 
      

```

But I thought there might be a better Juce way to do it?

The purpose here, of course, is to load a DLL into a plugin (which is itself a DLL, so cannot have these sort of linkages … hence the need for runtime loading).

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [November 5, 2011, 11:29am UTC](https://forum.juce.com/t/dynamicobject-question/7660/2 "2011-11-05T11:29:12Z")

</div>

There’s a DynamicLibrary class that wraps that stuff up in a RAII style - is that any help?
