hello
thank you IOhannes that was it.
btw i have another newbe question. if i need global variables for the pd external where would i put them and what would be the simplest case where you acctually have to write a deconstructor. in the tutorial externals there was nowhere a deconstructor specified.
best michael
michael gross wrote:
hello
compile the source i get only warnings and no errors but it still fails to compile.
well, if it fails to compile i guess there IS an error...
i am using the makefile provided in /usr/lib/pd/doc/6.externs and gcc-3.4 for compilation.
did you try to remove the "-Werror" flag from the makefile (which turns warnings into erros)?
mf.asdr. IOhannes
michael gross wrote:
hello
btw i have another newbe question. if i need global variables for the pd external where would i put them and what would be the simplest case where
well, you in the sample code you provided, you already have global variables. (you might want to declare them static too). to make local variables put them into the "obj1" struct.
you acctually have to write a deconstructor. in the tutorial externals there was nowhere a deconstructor specified.
oh, i forgot that...
<code> obj1_class = class_new(gensym("obj1"), (t_newmethod)obj1_new, 0, </code>
the "0" argument after the constructor is really a pointer to the destructor. so you have to write your destructor function:
void obj1_free(t_obj1*x){ /* Doh.... */ }
and then do obj1_class = class_new(gensym("obj1"), (t_newmethod)obj1_new, (t_method)obj1_free, ...
and you really should declare all functions (but the setup()!) as "static" unless you have reasons to not do so...
mfga.sd.r IOhannes