2

I'm using Delphi's fastMM memory manager and I fail when I try to use the full debug mode.

I get the following errors when compiling:

FastMM\FastMM4.pas(6872) Error: Undeclared identifier: 'RegisterExpectedMemoryLeak'
FastMM\FastMM4.pas(6948) Error: Undeclared identifier: 'UnregisterExpectedMemoryLeak'
FastMM\FastMM4.pas(9269)
import_test.dpr(24) Fatal: Could not compile used unit 'FastMM\FastMM4.pas'

The .inc file tells to load the full debug dll. I've already copied the FastMM_FullDebugMode.dll file everywhere. It looks like I should have included something in my project.

I'm probably missing something really obvious.

The Delphi version is 7.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
neves
  • 33,186
  • 27
  • 159
  • 192

1 Answers1

8

Turn on the EnableMemoryLeakReporting directive in the include file FastMM4Options.inc by changing it from:

{.$define EnableMemoryLeakReporting}

to:

{$define EnableMemoryLeakReporting}

Also read the comments in that file and understand the various options, turn them on/off as needed.

Ondrej Kelle
  • 36,941
  • 2
  • 65
  • 128
  • -1 You should better **not** touch the `FastMM4Options.inc` file (which is global to all applications), but set the `EnableMemoryLeakReporting` compiler conditional at the Project options level. – Arnaud Bouchez Oct 31 '11 at 15:17
  • 2
    @ArnaudBouchez If you think you have a better answer go ahead and post it. Your -1 means "This answer is not useful" which of course is an opinion you're entitled to, but I disagree. I think my answer is a valid and good one. – Ondrej Kelle Oct 31 '11 at 16:31
  • 1
    BTW, the weird thing is the necessity to have EnableMemoryLeakingReporting turned on when you are using FullDebugMode. I was just trying to debug an access violation, memory leaks are another kind of problem. – neves Nov 03 '11 at 22:08