Issue with setting icon for C++ program in Visual Studio 22

  Kiến thức lập trình

I have written a C++ program using Visual Studio 22 as my IDE, and I’m trying to set an icon for the program. When I specify the path to the icon, it works fine within Visual Studio. However, once I run the program as an executable from the folder, I receive an error message stating that it cannot find the icon.

Additionally, when I use resource hacker to add an icon, it appears in the taskbar but not in the top-left corner of the program window. I have been searching for a solution for a while now, but haven’t been able to find one. If anyone has a solution to this issue, I would greatly appreciate it.

New contributor

Dr Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.