How do I set build mode to -dDEBUG in Project Options/Other when defining -gh lazarus / 11-Options ---------------------------------------------------------------------- rjh58 · 2014-02-13 03:00 On the "http://wiki.freepascal.org/leakview" web page there is a description for re-directing heaptrc output to a file. That makes sense. The author makes the statement: "assuming your build mode sets -dDEBUG in Project Options/Other when defining -gh" inside of the following example:   {$IFDEF DEBUG}     // Assuming your build mode sets -dDEBUG in Project Options/Other when defining -gh     // This avoids interference when running a production/default build without -gh     // Set up -gh output for the Leakview package:     if FileExists('heap.trc') then       DeleteFile('heap.trc');       SetHeapTraceOutput('heap.trc');   {$ENDIF DEBUG} I want to put the above in my .lpr file at the beginning of the code section, but I don't know how to set custom options in Options | Other so that it automatically " sets -dDEBUG in Project Options/Other when defining -gh" like the example above. Can anyone help me with that? Thanks, Rich ---------------------------------------------------------------------- taazz · 2014-02-13 10:15 ermm, you don't. There are build modes supported you create a debug mode which has the -dDEBUG defined and the "use heaptrc unit" option checked. Then you create a release mode that has none of the above options and you are ready. ---------------------------------------------------------------------- rjh58 · 2014-02-14 01:38 Aha! I've got so little experience with Lazarus that I didn't even know about Build Modes. Thank you!