Debugging Memory Problems with MemoryScape : Chapter 4 Creating Programs for Memory Debugging : Linking with the dbfork Library : dbfork on IBM AIX on RS/6000 Systems
dbfork on IBM AIX on RS/6000 Systems
Add either the -dbfork or -ldbfork_64 argument to the command that you use to link your programs. If you are compiling 32-bit code, use the following arguments:
*/memscape_install_dir/lib/libdbfork.a bkeepfile:/usr/totalview/rs6000/lib/libdbfork.a
*-L/memscape_install_dir/lib ldbfork -bkeepfile:/usr/totalview/rs6000/lib/libdbfork.a
For example:
cc -o program program.c \
-L/usr/totalview/rs6000/lib/ -ldbfork \
-bkeepfile:/usr/totalview/rs6000/lib/libdbfork.a
If you are compiling 64-bit code, use the following arguments:
*/memscape_install_dir/lib/libdbfork_64.a \
-bkeepfile:/usr/totalview/rs6000/lib/libdbfork.a
*-L/memscape_install_dir/lib -ldbfork_64 \
-bkeepfile:/usr/totalviewrs6000//lib/libdbfork.a
For example:
cc -o program program.c \
-L/usr/totalview/rs6000/lib -ldbfork \
-bkeepfile:/usr/totalview/rs6000/lib/libdbfork.a
When you use gcc or g++, use the -Wl, -bkeepfile option instead of the  -bkeepfile option, which will pass the same option to the binder. For example:
gcc -o program program.c \
-L/usr/totalview/rs6000/lib -ldbfork -Wl, \
-bkeepfile:/usr/totalview/rs6000/lib/libdbfork.a