Results 1 to 4 of 4

Thread: Can't add an application icon to the static Qt application.

  1. #1
    Join Date
    Jun 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Can't add an application icon to the static Qt application.

    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)

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Can't add an application icon to the static Qt application.

    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.

  3. #3
    Join Date
    Jun 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can't add an application icon to the static Qt application.

    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).
    Last edited by JiJi Aloe; 23rd June 2013 at 13:39.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Can't add an application icon to the static Qt application.

    Good, now we know what compiler/tool chain you are using.
    Quote Originally Posted by Me
    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?
    Last edited by ChrisW67; 23rd June 2013 at 23:10.
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

Similar Threads

  1. Mac OS application icon problem
    By budda in forum Qt Programming
    Replies: 1
    Last Post: 10th December 2011, 05:41
  2. Application icon - Qt S60
    By ppaluch in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 23rd November 2010, 11:17
  3. How to set the application icon in Linux?
    By live_07 in forum Newbie
    Replies: 11
    Last Post: 24th September 2010, 09:39
  4. Application icon from .qrc file
    By cia.michele in forum Newbie
    Replies: 3
    Last Post: 6th May 2010, 02:06
  5. Application icon and big dlls
    By kei in forum Qt Programming
    Replies: 2
    Last Post: 15th June 2009, 18:38

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.