<p>I'm sure this problem has been solved before and I'm curious how its done. I have code in which, when run, I want to scan the contents of a directory and load in functionality.</p>

<p>Specifically, I am working with a scripting engine that I want to be able to add function calls to. I want the core engine to provide very limited functionality. The user should be able to add additional functions through 3rd party libraries, which I want the engine to scan for and load. How is this done?</p>

It depends on the platform. On win32, you call
```
LoadLibrary
```
to load a DLL, then get functions from it with
```
GetProcAddress
```
. On Unixy platforms, the equivalents are
```
dlopen
```
and
```
dlsym
```
.