How can I fix this delphi 7 compilation error - "Duplicate resources (s)"

I am trying to compile a Delphi 7 project that I have inherited and I get this error:

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

He says a warning, but actually a mistake - the compilation does not complete.

It seems that the two components - CRGrid and RapTree - somehow collide. Anyone have any ideas on how to fix this?

In addition to removing one of the components from the project, of course.

+3
source share
4 answers

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

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

+3
source
+3
source

You will need to go into the components and rename one of the resources, and then update the component code to use the new name. This is pain, but that’s all you can do.

+1
source

I know this is an old thread, but there is still an update for those who support the old code:

I had this problem and this is because the images in the RES files were named the same. Delphi7 has an image editor that can open RES files. Just open both RES files involved in the Duplicate Resource error and rename one of the duplicate duplicate resources. Save the RES files and recompile. I recently worked on it twice when I replaced an old component in a Delphi 7 application with a (slightly) new one.

+1
source

Source: https://habr.com/ru/post/1277590/


All Articles