---
name: "ccmalloc"
section: "1"
platform: "linux"
package: "ccmalloc"
version: "0.4.0-9"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/ccmalloc"
---

# ccmalloc(1)

Link C++ object files with ccmalloc debugging library

## NAME

ccmalloc - Link C++ object files with ccmalloc debugging library

## SYNOPSIS

**ccmalloc** **\[** *--no-wrapper* **\]** **\[** *gcc \| g++* **\]** **\[** *compiler-option ...* **\]** **file***...*

## DESCRIPTION

**ccmalloc** is a script that compiles object files from C or C++ code with the ccmalloc library.  The resulting code can be profiled for memory leaks and  other bad practices.

The script is used as a replacement of the link line.  When used with C++ code, simply prefix the command line with  **ccmalloc.** For example, if you normally link your program using

    g++ -o binary mod1.o mod2.o -lm

you simply use the following instead

    ccmalloc g++ -o binary mod1.o mod2.o -lm

With C code, prefix the command line instead with **ccmalloc --no-wrapper** to disable the C++ wrapper.  Linking C code with the C++ wrapper results in unresolved symbols.

Note that only  **gcc,** **g++,** and **g++-2.95** (on systems that have GCC 2.95) are recognized as compilers.

You should copy  */usr/share/doc/ccmalloc/examples/ccmalloc.cfg* to  *.ccmalloc* in your project directory and read it carefully.

Don't forget the  *-g* compiler flag if you plan to use a debugger.

## SEE ALSO

**/usr/share/doc/ccmalloc/examples/ccmalloc.cfg\[.gz\]**

## AUTHOR

Armin Biere
