Either link to -lsupc++ , or a small wrapper function (perhaps the best way for libc++ ) to implement glibc:
extern "C" int __cxa_thread_atexit(void (*func)(), void *obj, void *dso_symbol) { int __cxa_thread_atexit_impl(void (*)(), void *, void *); return __cxa_thread_atexit_impl(func, obj, dso_symbol); }
It might be worth mentioning that this only works with glibc> = 2.18.
source share