Subject: RE: [linux-audio-dev] LADSPA Update (http://www.ladspa.org)
From: David Benson (daveb_AT_idealab.com)
Date: Sun May 21 2000 - 20:30:01 EEST
> These same issues apply to any ladspa plugin which uses an external library
> beyond the standard C and maths library allowed in ladspa.h.
forgot this in the docs i sent out. instead of repeating
myself in response form, please read section 3.4.5.1 below.
the whole new section is repeated, since it changed.
- dave
3.4.5. Building LADSPA plugins
The process of building plugins is extremely nonportable, but we give
commands to compile a LADSPA plugin using the GNU tools.
If your plugin is a simple C plugin, try using commands like:
______________________________________________________________________
gcc -fPIC -DPIC -Wall -O2 -c -o my_plugin.o my_plugin.c
ld -shared -o my_plugin.so my_plugin.o
______________________________________________________________________
If your plugin uses an external library, you must add that to the ld
line:
______________________________________________________________________
ld -shared -o my_plugin.so my_plugin.o -lmy_library
______________________________________________________________________
The plugin will not load unless the library has been found.
If your plugin uses C++, it is far easier to use g++ to find the
various library that are needed:
______________________________________________________________________
g++ -fPIC -DPIC -shared -o my_plugin.so my_plugin.cc
______________________________________________________________________
Otherwise non-C++ hosts won't have the standard c++ libraries automat-
ically loaded for them.
If you use external libraries, add them on with -l, as above.
3.4.5.1. More on external libraries
Shared libraries are searched for according to the environment
variable LD_LIBRARY_PATH, then they use the system's shared library
table, which is generated by ldconfig.
In some rare cases, you may wish to support the loading of multiple
versions of the library which define different functions and
interfaces.
You have basically two choices:
o make N-versions of your plugin, using #ifdef to distinguish the
versions at compile time. This is likely easier, and perhaps more
traditional.
This has the disadvantage that the host must distinguish which
version of the underlying library is present.
o use dlopen and dlsym to make a single plugin that can load any
version of its library. This is more complex, but may be easier to
use.
This archive was generated by hypermail 2b28 : Sun May 21 2000 - 20:56:42 EEST