fatal error CVT1100: duplicate resource. type:ICON, name:1 (C++, Visual Studio C++ 2010)

后端 未结 2 2014
挽巷
挽巷 2021-01-20 05:15

I tried to add custom icons (13x13 dimention) to a project.

I cannot find why I cannot load icon.

CVTRES : fatal error CVT1100: duplicate reso

2条回答
  •  一生所求
    2021-01-20 06:04

    I ran into the same issue. Looks like it is impossible to merge .rc. files if they both have icons. Despite the non-overlapping numbering scheme you might have.

    See below explanation from Microsoft: Gary Chang has posted this interesting explanation elsewhere on the net:

    The following is more detail info on the root cause of this problem: "Basically what's happening is that Icon resources are composed of two different Win32 resource types C RT_GROUP_ICON and RT_ICON. You can think of RT_GROUP_ICON as a directory of RT_ICON resources. The RT_ICON resources are the actual icon images.

    The VC resource editor tries to simplify this for you in a single icon resource entity and under the hood handles some things like creation and ID naming of the individual RT_ICON resources (the #1 you're seeing in this case). The VC resource editor was also created back in the day when it was only possible to have a single .rc file in a given .exe or .dll. Changes have since been made in the command line tools to allow use of multiple .rc files to contribute to a given .exe or .dll but I don't believe the resource editor implementation was ever revisited with this new possibility in mind, at least from the standpoint of the way it handles icons.

    So with the current VC++ compiler,the only thing that can be done in this case if you want to have multiple resource files is to keep all icon (and cursor) resources in a single .rc file. That will let the VC resource editor keep all the RT_ICON identifiers unique."

    Wish this helps and thanks for your understanding! Best regards,

    Gary Chang Microsoft Community Support

提交回复
热议问题