Demangling compiled C++ names with c++filt

The c++filt utility is a filter that copies characters from file names or standard input to standard output, replacing all mangled names with their corresponding demangled names.

You can use the filter directly with file name arguments, and the filter will output the demangled names of all mangled names in the files; or you can use a shell command that inputs text, such as specific mangled names, and pipe it to the filter, so that the filter provides the demangled names of the names you specified.

Example when you get the following mangled symbol error:

symbol lookup error: ./lib.so: undefined symbol: _ZN9ArrayItemIPcEaSES0_

$ echo _ZN9ArrayItemIPcEaSES0_ | c++filt
ArrayItem::operator=(char*)

Much easier to debug when knowing where to look :)

Share

Uco Mesdag

A sysadmin by day and a coder by night. Working as a senior Linux system engineer with plus 20 years of experience. I write about Linux, tech, code and other things that have my interest.

You've successfully subscribed to Mesd.ag
Great! Next, complete checkout for full access to Mesd.ag
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.