## Writing Externals See [pure data site](https://puredata.info/docs/faq/writingexternals), which points to [this github](https://github.com/pure-data/externals-howto) and FlextCpp See [here](https://puredata.info/docs/faq/how-do-i-install-externals-and-help-files) for where to install externals. (On Linux it's `~/.local/lib/pd/extra/`). ## Simplest Example helloworld.c ```c #include "m_pd.h" static t_class *helloworld_class; typedef struct _helloworld { t_object x_obj; } t_helloworld; void helloworld_bang(t_helloworld *x) { post("Hello world!!"); } void *helloworld_new(void); void helloworld_setup(void) { helloworld_class = class_new(gensym("helloworld"), (t_newmethod)helloworld_new, 0, sizeof(t_helloworld), CLASS_DEFAULT, 0); class_addbang(helloworld_class, helloworld_bang); } void *helloworld_new(void) { t_helloworld *x = (t_helloworld *)pd_new(helloworld_class); return (void *)x; } ``` Makefile ``` # Makefile for mylib lib.name = helloworldlib class.sources = helloworld.c datafiles = include Makefile.pdlibbuilder ``` where Makefile.pdbuilder is [here](https://github.com/pure-data/externals-howto/blob/master/pd-lib-builder/Makefile.pdlibbuilder).