-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-02-21 16:36, katja wrote:
Hello,
I'd like to know opinions from experienced developers about the use of C versus C++ for dsp libs.
I'm planning to write a compact library with audio analysis functions, to be used with Pd in the first place, but meant to be portable to other real time dsp frameworks. This project will contain several routines which must share one interface to Pd, and C++ will be most convenient for it. I've used C and C++ for Pd classes before, and both seem to work properly and efficient. But I lack experience to know on beforehand if there is some disadvantage of using C++ for a reusable dsp library. This will be my first. Quite some dsp libs are written in C, even today. Is there good reason to refrain from C++'s conveniences for writing classes, and use C instead?
one problem with C++ is that name-mangling is different depending on which compiler/linker you are using. this basically means, that you cannot use your C++-library binary made with g++ in an application/... build with e.g. M$VC.
note that you can avoid this, if you provide a public "C" API, and use C++ only as an implementation detail (e.g. and pass classes around as anonymous structs)
fgmasdr IOhannes