As Thaddy said:remove HeapTrc from uses-Clause, encase your SetHeapTraceOutput with an {$IFDEF},either in project-options check "Use HeapTrace" or compile with -gh/-glhRun
You might put heaptrc as first unit in your uses clause ?