3

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.

4 Answers 4

3

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.

3

try this: Fixing the "Duplicate resource" error

1

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.