C Wrapper for C++
I'd like to use Pure Data as a prototyping tool for my own library. I found out that Pure Data patches are written in C, but my library is written in C++. So how can I use this code in pure data? Since I haven't used plain C, I'd like to know how I could write a C wrapper for C++ classes and how do instantiate my classes then? Or do I have to rewrite everything in C? You will need to write wrapper functions for every function which needs to be called. For example: // The C++ implementation class SomeObj { void func(int); }; extern "C" { SomeObj* newSomeObj() {return new SomeObj();} void