Hi,
after having created/compiled my own external, I tried to instal it in /usr/lib/pd/externals.... but with no luck
then I installed it manualy in my home folder ~/pd-externals/main/main.pd-linux
pd found it, but complains "main_setup" is not found, although it is there
here is a dump of the library
http://i.imgur.com/SWpwZxU.png
I compiled it doing this
g++ -Wall -c "main.c" -I"/usr/include/pd" -DPD -DVERSION='"0.0"' -fPIC -O6 -funroll-loops -fomit-frame-pointer -W -g -o "main.o"
g++ -Wall -rdynamic -shared -fPIC -Wl,-rpath,"\$ORIGIN",--enable-new-dtags -o "main.pd_linux" "main.o" -lc
chmod a-x "main.pd_linux"
can someone find what I do wrong ? Is it not supposed to work when compiled with c++ ? I prefer using c++ it has more posibilities than c
thanks
#include "/usr/include/pd/m_pd.h"
static t_class *main_class;
typedef struct _main
{
t_object x_obj;
} t_main;
void main_bang(t_main *x)
{
post("Hello world !! %p",x);
}
void *main_new(void)
{
t_main *x = (t_main *)pd_new(main_class);
return (void *)x;
}
void main_setup(void)
{
main_class = class_new(
gensym("main"),
(t_newmethod)main_new,
NULL,
sizeof(t_main),
CLASS_DEFAULT,
(t_atomtype)0);
class_addbang(main_class, main_bang);
}