The D(eimos) Dynamic Loader allows loading dynamic C libraries at run time. Consult its documentation for more information.
On Posix systems you need to link against libdl. libdl's license must permit linking considering ddl's license. A libdl implementation licensed under LGPL is fine.
There are no dependencies on Windows systems.
$ dmd path/to/ddl.d -L-ldl your_module.d
Note, that libdl must be also linked dynamically. It is linked already statically using pragma(lib, "dl").
$ dmd path/to/ddl.d your_module.d
See directory tests/ for some usage examples.
The tests assume that there is the standard C library and the ZeroMQ library on your system.
Unfortunately the tests are not portable. So be prepared for seeing them fail on your system.
$ dmd -unittest -version=ddl -Ipath/to/ddl/tests -L-ldl path/to/ddl.d -run tests/test_c.d
$ dmd -unittest -version=ddl -Ipath/to/ddl/tests -L-ldl path/to/ddl.d -run tests/test_zmq.d
Note this also runs ddl's unittests. Further, -version=ddl is needed to
verify the example in the documentation.
To run the tests on Windows leave linking of dl out.
See issues on github.
This software is released under the Boost License 1.0.