On Sun, Dec 02, 2007 at 05:33:52PM +0100, Lars Luthman wrote:
On Sun, 2007-12-02 at 15:58 +0100, Tim Goetze wrote:
[Rémi
Thébault]
I join my source code, my Makefile and the
compiled library (x86).
If somebody could have a look or just give some piece of advice on how
to make a plugin recognized, this would be a great help for me.
Since you are compiling as C++, you need
extern "C" {
/* your exported symbols go here */
}
enclosing at least the functions that you want to export (_init,
_fini, ladspa_descriptor).
Also, _init() and _fini() are deprecated - future versions of the
dynamic linker are not guaranteed to call them when loading and
unloading modules. You should use either the GCC-specific
__attribute__((constructor/destructor)) or something more portable, like
a global object of a class with a constructor and a destructor.
Actually you don't need _init() at all - all of the required
data structures can be defined statically.
The constructor for each plugin instance can be called in
instantiate().
The only "extern C" function you need is ladspa_descriptor(),
all the others can be static C++ functions of a plugin base
class.
Ciao,
--
FA
Lascia la spina, cogli la rosa.