Blorgbeard
Blorgbeard

Reputation: 103525

How can I fix this delphi 7 compile error - "Duplicate resource(s)"

I'm trying to compile a Delphi 7 project that I've inherited, and I'm getting this error:

[Error] WARNING. Duplicate resource(s):
[Error] Type 2 (BITMAP), ID EDIT:
[Error] File C:[path shortened]\common\CRGrid.res resource kept; file c:\common\raptree.RES resource discarded.

It says warning, but it's actually an error - compilation does not complete.

It looks like two components - CRGrid and RapTree - are colliding somehow. Does anyone have any ideas on how to fix this?

Other than removing one of components from the project, of course.

Upvotes: 3

Views: 8876

Answers (4)

Gabhan
Gabhan

Reputation: 11

I know this is an old thread, but still worth an update for anyone maintaining old code:

I had this problem and it was due to images in RES files being named the same thing. Delphi7 has an Image Editor which can open RES files. Simply open both RES files involved in the Duplicate Resource error, and rename one of the offending duplicate resources. Save the RES files and recompile. Has worked for me twice recently when I replaced an old component in a Delphi 7 app with a (slightly) newer one.

Upvotes: 1

Aidenn
Aidenn

Reputation: 559

try this: Fixing the "Duplicate resource" error

Upvotes: 3

jfs
jfs

Reputation: 240

Try firing up your resource editor (I'm pretty sure Delphi comes with one) and open the files. Check what bitmap resources are in the two, see which can be the duplicate.

If you need to keep both resources, you need to renumber one of them.

Upvotes: 3

Daniel
Daniel

Reputation: 4977

You'll need to go into the components and rename one of the resources and then update the component code to use the new name. It's a pain, but that's all you can do.

Upvotes: 1

Related Questions