On Jul 13, 2015, at 10:24 AM, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On Jul 2, 2015, at 4:20 PM, Alister Winfield <alister@ticklers.org> wrote:
From memory you can get away with compiling the 'main' as C++ and use C++ for the final linking phase.. That assumes you ensure the bits that link to "C" compiled code have the extern "C" stuff in the right place to ensure you don't get any C++ name mangling issues.
It seems fairly happy linking directly to the cassandra client library.
No odd crashes, memory leaks or SEGVs so far... It's actually a little confusing :)
It's in the v3.1.x branch if you felt like doing some light detective work.
https://isocpp.org/wiki/faq/mixing-c-and-cpp If you want to call overloaded functions from C, you must provide wrappers with distinct names for the C code to use. For example: • // C++ code: • void f(int); • void f(double); • extern "C" void f_i(int i) { f(i); } • extern "C" void f_d(double d) { f(d); } Maybe that's what's provided by the cassandra headers, they do advertise it as a C/C++ library. -Arran