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. Static link: Q_IMPORT_PLUGIN(qico) unresolved external symbol
Qt 6.11 is out! See what's new in the release blog

Static link: Q_IMPORT_PLUGIN(qico) unresolved external symbol

Scheduled Pinned Locked Moved Solved General and Desktop
21 Posts 8 Posters 22.6k Views 2 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi and welcome to devnet,

    Did you add:

    @QTPLUGIN += qico@

    to your pro file ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • I Offline
      I Offline
      igromanru
      wrote on last edited by
      #3

      [quote author="SGaist" date="1386002079"]Hi and welcome to devnet,

      Did you add:

      @QTPLUGIN += qico@

      to your pro file ?[/quote]

      [/quote]

      I have tryed to export the project to a .pro file and using QT Creator but I got other erros. I would like to keep using Visual Studio. Except for this error, I got no other problems with VS compiler.

      EDIT:
      And I am not if this parameter is the problem becouse "Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)" works great.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sanja1989
        wrote on last edited by
        #4

        Remove all "Q_IMPORT_PLUGIN" and add
        @QTPLUGIN += qico@
        to .pro file.

        EDIT:
        From my .pro files:
        @CONFIG += c++11 static
        INCLUDEPATH += $(QTDIR)\plugins\imageformats
        QTPLUGIN += qico@

        1 Reply Last reply
        0
        • I Offline
          I Offline
          igromanru
          wrote on last edited by
          #5

          Ok, but how can I use a .pro file? SO far as I know, Visual Studio don´t using the .pro file for compiling the application.
          And there are no .pro, .pri or other Qt files in my project folder.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sanja1989
            wrote on last edited by
            #6

            I suggest you to use Qt Creator for developing but Visual Studio only for compilation. I think Creator is much more better for editing Qt sources.
            Qt Creator will make a .pro file for new project.

            1 Reply Last reply
            0
            • I Offline
              I Offline
              igromanru
              wrote on last edited by
              #7

              Sorry but I am not satisfied with this answer. I have created my Application complete in VS. Until I switched to static version everything has worked correctly. And after switching to static I could import the windows plugin (Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)) without any problems.
              There must be a solution to do the same with ico plugin. If is it an issue, it should be reported and fixed.
              To switch an IDE each time if something doesn´t woks, it´s not a solution for me.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                Silly question but… Since you built Qt yourself, are you sure that you built the ico image format ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • I Offline
                  I Offline
                  igromanru
                  wrote on last edited by
                  #9

                  [quote author="SGaist" date="1386279598"]Silly question but… Since you built Qt yourself, are you sure that you built the ico image format ?[/quote]
                  How can I check it in the build version?
                  I have never said that I have built Qt by myself. I got it from a friend. It´s version 5.1.2 from the stable git repository. In the plugins/imageformats folder I got qico.lib and qicod.lib.

                  1 Reply Last reply
                  0
                  • raven-worxR Offline
                    raven-worxR Offline
                    raven-worx
                    Moderators
                    wrote on last edited by
                    #10

                    [quote author="igromanru" date="1386089950"]Ok, but how can I use a .pro file? SO far as I know, Visual Studio don´t using the .pro file for compiling the application.
                    And there are no .pro, .pri or other Qt files in my project folder.[/quote]
                    Then add the qico.lib to the project's "Additional Dependencies" option.
                    Right click on the project and click Properties. In the "Linker"-Section you can add the qico.lib file and set a "Additional Library Directories". So the Linker can find the symbols.

                    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                    If you have a question please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      igromanru
                      wrote on last edited by
                      #11

                      [quote author="raven-worx" date="1386317327"]
                      Then add the qico.lib to the project's "Additional Dependencies" option.
                      Right click on the project and click Properties. In the "Linker"-Section you can add the qico.lib file and set a "Additional Library Directories". So the Linker can find the symbols.
                      [/quote]
                      I got it all the time.
                      That how it looks like: "JPG":https://www.dropbox.com/s/gf0work3tdci24h/add_dep.JPG (German version)
                      It´s a screenshot of the debug settings, but the release settings looks similiar.

                      1 Reply Last reply
                      0
                      • raven-worxR Offline
                        raven-worxR Offline
                        raven-worx
                        Moderators
                        wrote on last edited by
                        #12

                        and $(QTDIR) points to the correct path? You can check if you click on the "Command Line" entry in the Linker section

                        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                        If you have a question please use the forum so others can benefit from the solution in the future

                        1 Reply Last reply
                        0
                        • I Offline
                          I Offline
                          igromanru
                          wrote on last edited by
                          #13

                          [quote author="raven-worx" date="1386321519"]and $(QTDIR) points to the correct path? You can check if you click on the "Command Line" entry in the Linker section[/quote]
                          If $(QTDIR) would be a wrong path, I would have many problems in the whole project. And the windows plugin works too.

                          1 Reply Last reply
                          0
                          • raven-worxR Offline
                            raven-worxR Offline
                            raven-worx
                            Moderators
                            wrote on last edited by
                            #14

                            haha...good point... sry for this :)

                            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                            If you have a question please use the forum so others can benefit from the solution in the future

                            1 Reply Last reply
                            0
                            • I Offline
                              I Offline
                              igromanru
                              wrote on last edited by
                              #15

                              No more ideas?
                              I think I will try to make a static build by myself. Maybe it will help.

                              1 Reply Last reply
                              0
                              • K Offline
                                K Offline
                                kroman
                                wrote on last edited by
                                #16

                                This works for me:
                                ...
                                Q_IMPORT_PLUGIN (QICOPlugin)
                                ...

                                I have looked in qicod.lib and have found qt_static_plugin_QICOPlugin function symbol.

                                1 Reply Last reply
                                1
                                • S Offline
                                  S Offline
                                  steno
                                  wrote on last edited by
                                  #17

                                  [quote author="igromanru" date="1386003876"]
                                  "Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)" works great.
                                  [/quote]

                                  Which libraries did you link with to get this to work? I'm trying to clear up a small hand full of linker errors with qwindows.lib.

                                  1 Reply Last reply
                                  0
                                  • I Offline
                                    I Offline
                                    igromanru
                                    wrote on last edited by
                                    #18

                                    [quote author="couragic" date="1390806939"]This works for me:
                                    ...
                                    Q_IMPORT_PLUGIN (QICOPlugin)
                                    ...

                                    I have looked in qicod.lib and have found qt_static_plugin_QICOPlugin function symbol.[/quote]
                                    Thank you very much. This was the solution!

                                    [quote author="steno" date="1393375998"][quote author="igromanru" date="1386003876"]
                                    "Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)" works great.
                                    [/quote]

                                    Which libraries did you link with to get this to work? I'm trying to clear up a small hand full of linker errors with qwindows.lib.[/quote]
                                    Sorry for late answer.
                                    This is all my linked LIBs:
                                    qtmain.lib
                                    Qt5Core.lib
                                    Qt5Gui.lib
                                    Qt5Widgets.lib
                                    qico.lib
                                    ws2_32.lib
                                    sicudt.lib
                                    sicuuc.lib
                                    qminimal.lib
                                    qwindows.lib
                                    opengl32.lib
                                    Qt5PlatformSupport.lib
                                    imm32.lib
                                    winmm.lib

                                    1 Reply Last reply
                                    0
                                    • I igromanru

                                      Hello Qt-Community,

                                      I go a unsolved problem. I couln´t find a solution in google or in the forum so I have to ask here.

                                      I want to compile a static version of my program for privat use but I got the following problem:
                                      I see no icons in my application, as a solution I have found "this":http://qt-project.org/forums/viewthread/13367 thread.
                                      So I have added "Q_IMPORT_PLUGIN(qico)" in my main.cpp.
                                      @#include <QApplication>
                                      #include <QtPlugin>

                                      Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
                                      Q_IMPORT_PLUGIN(qico)@

                                      If I try to compile, I get this error:
                                      @main.obj : error LNK2019: unresolved external symbol ""struct QStaticPlugin const __cdecl qt_static_plugin_qico(void)" (?qt_static_plugin_qico@@YA?BUQStaticPlugin@@XZ)" in function ""public: __thiscall StaticqicoPluginInstance::StaticqicoPluginInstance(void)" (??0StaticqicoPluginInstance@@QAE@XZ)".@

                                      My Dev system:
                                      Visual Studio 2012, Windows 7 x64.
                                      Under Linker-> Input I have added "qico.lib" and all other necessary libs as additional dependencies.
                                      Without "Q_IMPORT_PLUGIN(qico)" I can compile my application and it´s works fine.

                                      J Offline
                                      J Offline
                                      John Sebastian Peterson
                                      wrote on last edited by
                                      #19

                                      i got this message from CONFIG+=static

                                      the problem is that StaticqicoPluginInstance is nowhere in the 5.4 package. it has no qico.lib

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #20

                                        Hi and welcome to devnet,

                                        You won't find this file in a Qt package as they only provide dynamic libraries. If you want a static Qt you'll have to build it yourself. Be aware of the licensing issues that comes with it.

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • P Offline
                                          P Offline
                                          Peter_Uspenskiy
                                          wrote on last edited by
                                          #21

                                          You need to add QT_STATICPLUGIN to your preprocessor macro, when buildimg plugin

                                          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