Delphi 7 Compilation Error - "Duplicate Resource (s)" between .res and .dfm

I got a very similar error with the below:

How can I fix this delphi 7 compilation error - Duplicate Resources

However, I got an error:

[Error] WARNING. Duplicate resource(s): [Error] Type 10 (RCDATA), ID TFMMAINTQUOTE: [Error] File P:\[PATH SNIPPED]\Manufacturing.RES resource kept; file FMaintQuote.DFM resource discarded. 

Manufacturing.res is the default resource file (the application is called Manufacturing.exe), and FMainQuote is one of the forms..dfm files are text files, so I'm not sure which resources are duplicated, how to find and fix them?

If I tried to compile the project again, it works fine, but the exe icon is different from the one I set in the project settings using the "Download icon" button. The icon in the application is a kind of bell image that I do not know.

+4
source share
8 answers

Try renaming Manufacturing, res to Manufacturing.bak or something else. Delphi should recreate the res file.

Of course, you will need to recreate any links, lines, etc. in the res file in a new one, but still worth a try ...

+2
source

try to find additional {$ R * .res} or {$ R * .dfm}, you may have copied it from somewhere.

+6
source

Delphi converts all of your DFM files to resources and calls them a class name. You can verify this using the resource editor and opening any form-based Delphi-based applications.

search all of your blocks for instances of the TFMMAINTQUOTE form. It is most likely in two units, one of which is NOT related to your project, but is pulled through the uses clause referring to the wrong unit (incorrect, because it stores a different name, but has a NAME form name, if it was part of your project, then the compiler will complain when you add the device first).

A simple solution to this problem is to find the TFMMAINTQUOTE form in your project and rename the form to something else, but then the old TFMMAINTQUOTE will still be pulled in.

I suggest using a good directory grep tool, for example in GExperts , to do a search. This will save you a lot of time and can be configured to search on your hard drive if necessary. The advantage of GExperts is that it is free and integrates directly into the Delphi development environment.

+5
source

I got the same error. I believe the following factors:

  • no * .res-file
  • common units with another project
  • the project with the error had a form with the same name as the form in this other project

Solution: rename the form (in the project with an error message)

+1
source

This type of "WARNING". Duplicate resource: The resource stored in the file resource has been dropped "appeared to me in Delphi 7 recently when I tried to reinstall the DBISAM database component in the palette.

 File D:\DELPHI\DBISAM\db324d6d.res resource kept; file D:\DELPHI\DBISAM\db324d6d.res resource discarded. Type 14 (ICON GROUP), ID MAINICON: 

As you can see above, when exactly such a situation with the Delphi error associated with RES appears , there are two identical notifications for the same resource , here in the "D: \ DELPHI \ DBISAM \ db324d6d.res" file.

At first, I thought that there were resources from two vendor packages that contradict each other, so I ripped and tore apart other installed components. After 4 hours or amniotic struggle, I finally discovered that there was another resource link for the DBISAM DPK package file:

 package db324d6d; {$R *.res} {$R 'db324d6d.res'} ... 

Now I remembered that DBIsam complained about a “missing .RES resource file” about a week ago or so. I regularly checked and made sure that the line exists in the DPK file and the RES file on the disk. At this point, I probably somehow added this second line to the DPK file, but I received the package and I was able to work with it all week.

Now that the excess line has hit, and hit hard. I just love there 4 hours of Saturday's fight.

Soon, how to fix it: delete the last of these resource lines. An error appears while both are pointing to the same resource.

So, only this needs to be left:

 package db324d6d; {$R *.res} ... 

Hope this helps someone else.

+1
source

optional {$R *.res} is in the * .dpr file as follows:

 program Test; uses Forms, Unit1 in 'Unit1.pas' {Form1}, Sample in 'Sample.pas', Proc in 'Proc.pas'; {$R *.res} //<----delete this if you put them in the Unt1.pas. ok. begin Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; end. 
0
source

If you rename a and this form is listed in the Uses part of other Units, you will get the above error.

The solution is a mixture of the above.

(1) Change the resource file ending in .bak (so it will be recreated later). (2) Search all devices and change the link to the old device / form name to a new one. (3) recompile and will now be fine.

0
source

Edit the RES file and remove the duplicate resource from it. Thus, you can save your original icon.

0
source

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


All Articles