Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] Qt static missing icon plugin
Forum Update on Monday, May 27th 2025

[SOLVED] Qt static missing icon plugin

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 4 Posters 5.7k Views
  • 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.
  • L Offline
    L Offline
    le_gweg
    wrote on 12 Jan 2012, 10:33 last edited by
    #1

    Hi all,

    I'm new to qt and tried to compile my first app 2 days ago everything went fine, but had to build a static version of Qt to embed dlls with my app.
    I religiously followed the processed described @ http://developer.qt.nokia.com/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc.
    Now, the app has all the required dlls in but the icons are ignored. The window icon, app icon, even a QPushButton icon are not present when compiled with the static build.
    Could any of you share his light and tell me want I have forgotten (because let's face though it's hard to say I've forgotten something)

    Greg

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on 12 Jan 2012, 10:54 last edited by
      #2

      Welcome to devnet

      I am wondering what your actual problems is? Can you show please what you like to see and what you see?
      If you are using your own icons they are no part of the static library build.

      PS: Just as terminology note. A static build does not have dlls in there. In a static build all routines and methods are compiled and in a static library. The functionality as otherwise in the dlls is now in the static lib rather than in a dll.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on 12 Jan 2012, 11:04 last edited by
        #3

        You must link the imageformat plugins statically to your application too (they cannot be loaded dynamically during runtime as with the shared lib version).

        See http://developer.qt.nokia.com/doc/qt-4.8/plugins-howto.html#static-plugins for the details, please. The actual set of imageformat plugins to link depends on your icons and other graphics you use.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • L Offline
          L Offline
          le_gweg
          wrote on 12 Jan 2012, 12:17 last edited by
          #4

          Thanks for your help

          So basically what has to be done is:

          in .pro file :
          add QTPLUGIN += qico
          add LIBS += path to qico parent folder

          in main.cpp
          add #include <QtPlugin>
          add Q_IMPORT_PLUGIN(qico)

          that's it.

          thanks again

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcwork
            wrote on 10 Apr 2014, 06:44 last edited by
            #5

            Ie_gweg,

            I've exactly the same problem.
            I've followed your instructions, but still I have a problem. It is related to the LIBS row in the .pro file.
            I have found in the directory structure of my static qt "pico.prl" (whatever prl means) here:
            c:\Qt\static\5.2.1\plugins\imageformats

            If I add in the .pro file
            LIBS +=c:\Qt\static\5.2.1\plugins\imageformats

            I get the following error:

            cannot find LIBS +=c:\Qt\static\5.2.1\plugins\imageformats: Permission denied

            The same occurs if I repeat the procedure, but indicating the path file up to plugins (i.e. excluding imageformats).

            Can you, please, advise?
            Thanks a lot.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcwork
              wrote on 10 Apr 2014, 06:50 last edited by
              #6

              Sorry,
              it was very easy!
              I use Qt 5.2.1.

              The only thing it was needed is to add in the.pro file
              QTPLUGIN += qico

              There was non need for LIBS, nor for the macro in main().

              Thanks, anyway.

              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