Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to demangle a C++ name in clang (or gcc)?

Tags:

c++

gcc

abi

clang

I'm trying to write a quick-and-dirty demangler for clang. I've found a piece of code that uses abi::__cxa_demangle, but I can't figure out which header it requires. The obvious choice is ABI.h but:

demangle.cpp:2:10: fatal error: 'ABI.h' file not found
#include <ABI.h>
         ^

What do I need to use abi::__cxa_demangle?

like image 700
Adam Avatar asked Mar 22 '23 01:03

Adam


1 Answers

Include cxxabi.h. In Ubuntu 13 this header is in /usr/include/c++/4.x where x is minor gcc version.

like image 178
Marat Dukhan Avatar answered Apr 02 '23 23:04

Marat Dukhan