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

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)

Answers


Perhaps posting your .dpr would help illustrate your problem. My project files look like this and give me no problem:

program Example;

{$R *.res}

uses
  Unit1 in 'Unit1.pas' {frmUnit1};

begin
  Application.Initialize;
  Application.CreateForm(TfrmUnit1, frmUnit1);
  Application.Run;
end.

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.


Need Your Help

ContextConfiguration inheritance in junit

spring junit easymock

I am trying to mock a service thats fetch data from redis.I have injected the beans in spring context in a new context file test-context.xml But I have other contexts files A.xml,B.xml which refere...

Error in configuring iOS App for Push Notifications with Parse

ios xcode swift push-notification ios-provisioning

I am following all the instructions here (i'm using Swift) without error. I can even build the project fine. When I connect my iPhone (5C) and try to run the app on the phone, I get the following e...