Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Setting up icon for exe-files in qt 4.8.1
Qt 6.11 is out! See what's new in the release blog

Setting up icon for exe-files in qt 4.8.1

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 7.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    safrano
    wrote on last edited by
    #1

    hello,

    i try to set up an icon file for the exe file, but its not working. under windows.
    i add
    @
    win32: RC_FILE += printer.rc
    @

    to printer.pro project file

    and add a

    printer.ico file
    and a
    printer.rc file with this line:

    @
    IDI_ICON1 ICON DISCARDABLE "robbie20_obj.ico"
    @

    the compiling error (under release and debug)

    @
    :-1: Error:[c:/.../printer_obj_res.o] Error 1
    @
    any idea why this occures?

    thanks in advance

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      Why do you use DISCARDABLE declaration?
      any way, you should show more line of compiler error. With just one line is hard to say something over then "you have an error in resources".

      And why you use "robbie20_obj.ico" if you has added printer.ico?

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        safrano
        wrote on last edited by
        #3

        hi,
        DISCARDABLE because of here:

        http://doc.qt.nokia.com/4.7-snapshot/appicon.html

        yes, sry too much c&p

        there is no robbie20_obj.ico, only printer.ico, i tried to copy and paste it out of an old orphan dead project.

        @
        windres: c:\Users\me\QT\printer\debug\printer_res.o: No such file or directory
        mingw32-make.exe[1]: *** [c:/Users/me/QT/printer/debug/printer_res.o] Error 1
        mingw32-make.exe: *** [debug] Error 2
        11:30:37: Der Prozess "C:\QtSDK\mingw\bin\mingw32-make.exe" wurde mit dem Rückgabewert 2 beendet.
        Fehler beim Erstellen des Projekts printer(Ziel: Desktop)
        Bei der Ausführung von Build-Schritt 'Make'
        @

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AcerExtensa
          wrote on last edited by
          #4

          It looks like windres can't find generated object file from .rc(?) or maybe generated object file from .h(?)... Maybe it is saved elsewhere then c:\Users\me\QT\printer\debug. Try to search for printer_res.o or maybe for printer.o

          You can try to manually genereate object file from resource too:
          @windres.exe printer.rc printer_res.o @
          Try it

          God is Real unless explicitly declared as Integer.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            safrano
            wrote on last edited by
            #5

            thanks
            where do i find this exe.

            a way for me to compile it is to compile it without the line
            @
            IDI_ICON1 ICON DISCARDABLE "robbie20_obj.ico"
            @

            and then i copy the
            C:\Users\me\QT\printer-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Release\release folder into

            C:\Users\me\QT\printer

            then add the line again and it works, but its not confortable for use, isn't there a nicer way?
            like this it find all files it needs to compile.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AcerExtensa
              wrote on last edited by
              #6

              Something is wrong with the paths in your Makefile. If it doesn't build with the shadow build, build it directly in printer folder.

              windres.exe should be in the mingw bin path.

              God is Real unless explicitly declared as Integer.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                safrano
                wrote on last edited by
                #7

                the point is that sometimes i build static release and sometimes during development, i build shared debug.

                so everything in one folder would be chaos.
                where can i check the makefile.
                this error happens for both cases, static release and shared debug.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  AcerExtensa
                  wrote on last edited by
                  #8

                  Just open your Makefile and check each executable command where.

                  God is Real unless explicitly declared as Integer.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved