Delphi adding {$R *.res} in the .dpr file

delphi

Delphi sometimes adds {$R *.res} in front of the unit path in the .dpr file uses clauses, then I get a duplicated resources warning when trying to compile.

Anyone knows why the hell Delphi does that? I'm using Delphi 2009 but this happens since Delphi 2007 (maybe 2006 too)

Best Answer

It depends on what else you've done to the .dpr file. Delphi expects that file to be layed out in a certain way, and if you've modified it in such a way that the internal IDE parsers are unable to correctly find certain things, it can guess wrong. Originally, the .dpr file was never intended for the user to modify at will, and so it can get confused. IFDEFS are the most common culprits which can confuse the IDE parser.

Related Topic