I have two types of function pointers defined in my C++ that look like this:
typedef void(*CallbackFn)(bool, std::str
C doesn't do / cannot handle C++ name mangling (nor C++ types that are not identical to C types). You cannot use non-POD types (and plain function pointers involving types not usable in C) in anything exposed to C. And you need to use extern "C"
for the exposed stuff, to disable name mangling (or rather, use whatever naming convention/mangling your current platforms C compiler uses).
In short: use extern "C"
for anything that must be callable from C and make sure anything exposed that way only uses types that you can write/use in C.