Note 64: In Delphi 2007 [the first non-patched version] the wizard generates a project that doesn't compile. The same happens if you move an existing DUnit project written in a past version of Delphi. The problem is that the source code included (in RAD Studio/5.0/source/dUnit/src) has been only partially synchronized with a new version of DUnit that integrates with FastMM memory checking. What happens is that the TestFramework unit in that source folder refers to a missing unit, FastMMMemLeakMonitor. You have two options: download the missing unit from the project source or, the simplest technique, remove the reference to the DUnit source code folder in the Directories/Conditional page of the Project options. The DCU-compiled version of the TestFramework unit, in fact, works fine. This problem is reported on QualityCentral with number 43201, so you can find it at the address

As of today this is not true any more, although I'm not sure if this was fixed with Update 3 / RAD Studio or with the recent December patch. The FastMMMemLeakMonitor is now part of the dUnit source. However, on Vista you still hit a problem. If you don't set a unit output folder it tries to compile the unit (which is not in the lib folder) to the local directory, which is under Program Files and as such protected by default. This is the error I get:

[DCC Error] FastMMMemLeakMonitor.pas(274): F2039 Could not create output file 'c:\program files\codegear\rad studio\5.0\Source\DUnit\src\FastMMMemLeakMonitor.dcu'

The fix is quite obvious (set a unit output directory or give extra permissions to that folder), but it would have been nicer to be able to say it worked smoothly. It did not.

This blog post is part of my "113 Delphi 2007 Handbook Notes" blogging project, to promote my new Delphi book.