PDA

View Full Version : Can't add an application icon to the static Qt application.



JiJi Aloe
22nd June 2013, 21:11
I searched this forum and google, but I have not found a solution.

I have a problem with the application icon (icon of executable application in Windows explorer).
My environment - Qt 4.7.0, Qt Creator 2.0.1, Windows 7, 32-bits.
When Qt was originally, dynamically linked everything was ok. In the main project folder are: app.ico and myResource.rc. RC file contains:

IDI_ICON1 ICON DISCARDABLE "app.ico"

In .pro file is line RC_FILE = myResource.rc.

When I linked Qt statically all stopped working. The project will not build. When I try build an application error pops up:
[release / myResource_res.o] ERROR1

This problem is with each resource (Windows resource in .rc file) not only with icon. When myResource.rc is empty problem exists too.

Any idea how to fix it? I want one exe file with nice application icon (shows by windows explorer)

ChrisW67
23rd June 2013, 01:50
What is the command generating the error and the full message? What compiler/tool chain are you using?

By your own admission the error has nothing to do with the icon itself.

JiJi Aloe
23rd June 2013, 13:24
I'm using Qt Creator with mingw compiler (default settings).

This is a full error message which Qt Creator generate:

[release / myResource_res.o] ERROR1

This problem appeared when I compiled Qt library statically. Previously everything worked.

The problem is with each resource (ICON, CURSOR, VERSIONINFO etc.).

I appeal to people, who have qt statically compiled and run on Windows, Qt Creator and Mingw compiler. Try build the application with icon as a resource (.rc file).

ChrisW67
23rd June 2013, 22:52
Good, now we know what compiler/tool chain you are using.

What is the command generating the error ... ?
I ask because Qt Creator did not generate this error message, one of the tools in the tool chain did (maybe windres). Look at the Compiler Output panel in Qt Creator.

Does the file "release/myResource_res.o" exist?
Is it zero bytes in size?
Are there spaces in the path to your sources or build directory?