Hallo Thomas, list!
I have a problem with flext in the following situation: I derive from a class, which is derived from flext_dsp, but should have no setup function, ...
example:
class A : public flext_dsp { FLEXT_HEADER(A,flext_dsp)
[...]
// no setup function here }
class B : public A { FLEXT_HEADER_S(B,A,setup)
[...]
private:
static void setup(t_classid c); FLEXT_CALLBACK(some_methods_from_A_or_B) };
FLEXT_NEW_DSP_V("B_name",B)
void B::setup(t_classid c) { [...] }
everything compiles fine, but when I try to load B.pd_linux I get: load_object: Symbol "B_setup" not found
Thanks for any hints, LG Georg
Georg Holzmann wrote:
Thanks for any hints,
since i am no flext-man i have little ideas, but: try running the pre-processor on your file (B.cpp), to see how all the macros expand. there has to be a "void B_setup(void)" function defined (in C-scope!), to make pd load it.
mfg.asdr. IOhannes
Hallo!
I just read the documentation on how to write libs in flext (should have done that before ... :) - and so it works: (but maybe there is also an other solution ? - because I don't need a library, I need only this single object ... ?)
class A : public flext_dsp { FLEXT_HEADER(A,flext_dsp)
[...]
// no setup function here }
class B : public A { FLEXT_HEADER_S(B,A,setup)
[...]
private:
static void setup(t_classid c); FLEXT_CALLBACK(some_methods_from_A_or_B) };
FLEXT_LIB_DSP_V("B",B)
void B::setup(t_classid c) { [...] }
static void lib_setup() { // call the objects' setup routines FLEXT_DSP_SETUP(B); }
// setup the library FLEXT_LIB_SETUP(B,lib_setup)
LG Georg
Hallo!
Unfortunately I have still some problem: when I make it in the way as below, the constructor of class A will be called before the setup function ... is that correct behauviour? The problem is, that I have to setup some stuff (at setup time), which is also needed by calls A ... :(
Thanks, LG Georg
class A : public flext_dsp { FLEXT_HEADER(A,flext_dsp)
[...]
// no setup function here }
class B : public A { FLEXT_HEADER_S(B,A,setup)
[...]
private:
static void setup(t_classid c); FLEXT_CALLBACK(some_methods_from_A_or_B)
};
FLEXT_LIB_DSP_V("B",B)
void B::setup(t_classid c) { [...] }
static void lib_setup() { // call the objects' setup routines FLEXT_DSP_SETUP(B); }
// setup the library FLEXT_LIB_SETUP(B,lib_setup)
LG Georg
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Hi,
when I make it in the way as below, the constructor of class A will be called before the setup function ... is that correct behauviour? The problem is, that I have to setup some stuff (at setup time), which is also needed by calls A ... :(
the constructor should only be called upon instantiation of an actual object, not during class setup (in the course of the lib_setup function). Do you have working source code illustrating the problem?
gr~~~
class A : public flext_dsp { FLEXT_HEADER(A,flext_dsp) [...] // no setup function here } class B : public A { FLEXT_HEADER_S(B,A,setup) [...] private: static void setup(t_classid c); FLEXT_CALLBACK(some_methods_from_A_or_B) }; FLEXT_LIB_DSP_V("B",B) void B::setup(t_classid c) { [...] } static void lib_setup() { // call the objects' setup routines FLEXT_DSP_SETUP(B); } // setup the library FLEXT_LIB_SETUP(B,lib_setup) LG Georg _______________________________________________ PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
-- =%)!:?"§<§0&-"|>* http://grh.mur.at
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Hallo!
the constructor should only be called upon instantiation of an actual object, not during class setup (in the course of the lib_setup function).
yes - as it should ... forget it, I tried yesterday some stuff (different macros, modified them a little bit ...) - so now everything is okay again ...
LG Georg
Hi Georg, the problem might be smaller than you think.... a DSP object (which is one derived from flext_dsp) needs to be called B~ and also the resulting binary. B_setup is not found, but B_tilde_setup would be. This restriction doesn't apply to object libraries.
gr~~~
Am 31.10.2005 um 13:44 schrieb Georg Holzmann:
Hallo Thomas, list!
I have a problem with flext in the following situation: I derive from a class, which is derived from flext_dsp, but should have no setup function, ...
example:
class A : public flext_dsp { FLEXT_HEADER(A,flext_dsp)
[...]
// no setup function here }
class B : public A { FLEXT_HEADER_S(B,A,setup)
[...]
private:
static void setup(t_classid c); FLEXT_CALLBACK(some_methods_from_A_or_B)
};
FLEXT_NEW_DSP_V("B_name",B)
void B::setup(t_classid c) { [...] }
everything compiles fine, but when I try to load B.pd_linux I get: load_object: Symbol "B_setup" not found
Thanks for any hints, LG Georg
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev