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. undefined reference to qt_static _plugin
QtWS25 Last Chance

undefined reference to qt_static _plugin

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt 5.5staticplugin
14 Posts 3 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.
  • jsulmJ jsulm

    @NIXIN I think you forgot "QTPLUGIN += " in your pro file as described here: http://doc.qt.io/qt-5/plugins-howto.html#static-plugins

    NIXINN Offline
    NIXINN Offline
    NIXIN
    wrote on last edited by
    #3

    @jsulm what should I add with QTPLUGIN +=

    because I am creating my own plugin

    jsulmJ 1 Reply Last reply
    0
    • NIXINN NIXIN

      @jsulm what should I add with QTPLUGIN +=

      because I am creating my own plugin

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #4

      @NIXIN Sorry, my post was wrong.
      "Link your application with your plugin library using LIBS in the .pro file." - so, using LIBS is correct. But you're using it wrongly, it should be:

      LIBS    += -L"/home/uidm9805/Qt Projects/static_plugin_qmake/build/plugin_qmake" -lplugin_qmake
      

      Better to use relative paths, see http://doc.qt.io/qt-5/qtwidgets-tools-plugandpaint-app-example.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      NIXINN 1 Reply Last reply
      0
      • jsulmJ jsulm

        @NIXIN Sorry, my post was wrong.
        "Link your application with your plugin library using LIBS in the .pro file." - so, using LIBS is correct. But you're using it wrongly, it should be:

        LIBS    += -L"/home/uidm9805/Qt Projects/static_plugin_qmake/build/plugin_qmake" -lplugin_qmake
        

        Better to use relative paths, see http://doc.qt.io/qt-5/qtwidgets-tools-plugandpaint-app-example.html

        NIXINN Offline
        NIXINN Offline
        NIXIN
        wrote on last edited by NIXIN
        #5

        @jsulm I tried using LIBS += the way you suggested, however still it is not working...
        getting same errors again

        jsulmJ 1 Reply Last reply
        0
        • NIXINN NIXIN

          @jsulm I tried using LIBS += the way you suggested, however still it is not working...
          getting same errors again

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #6

          @NIXIN Can you show your LIBS line from your pro file?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          NIXINN 1 Reply Last reply
          0
          • jsulmJ jsulm

            @NIXIN Can you show your LIBS line from your pro file?

            NIXINN Offline
            NIXINN Offline
            NIXIN
            wrote on last edited by
            #7

            @jsulm

            TEMPLATE = app
            QT      += widgets
            
            HEADERS  = interface.h
            
            SOURCES += main.cpp
            
            #LIBS    += "/home/uidm9805/Qt Projects/static_plugin_qmake/build/plugin_qmake/libplugin_qmake.a"
            
            LIBS    += -L"/home/uidm9805/Qt Projects/static_plugin_qmake/build/plugin_qmake" -lplugin_qmake
            
            jsulmJ 1 Reply Last reply
            0
            • NIXINN NIXIN

              @jsulm

              TEMPLATE = app
              QT      += widgets
              
              HEADERS  = interface.h
              
              SOURCES += main.cpp
              
              #LIBS    += "/home/uidm9805/Qt Projects/static_plugin_qmake/build/plugin_qmake/libplugin_qmake.a"
              
              LIBS    += -L"/home/uidm9805/Qt Projects/static_plugin_qmake/build/plugin_qmake" -lplugin_qmake
              
              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #8

              @NIXIN You should check the linker call as you have a space in your path which can cause issues (you should avoid spaces in paths).

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              NIXINN 1 Reply Last reply
              0
              • jsulmJ jsulm

                @NIXIN You should check the linker call as you have a space in your path which can cause issues (you should avoid spaces in paths).

                NIXINN Offline
                NIXINN Offline
                NIXIN
                wrote on last edited by
                #9

                @jsulm I tried same thing with this example http://doc.qt.io/qt-5/qtwidgets-tools-plugandpaint-app-example.html and its working fine there

                LIBS += "/home/uidm9805/Qt Projects/plugandpaint/build/plugandpaint/plugins/libpnp_basictools.a"
                

                don't know why this project is behaving in odd manner

                jsulmJ 1 Reply Last reply
                0
                • NIXINN NIXIN

                  @jsulm I tried same thing with this example http://doc.qt.io/qt-5/qtwidgets-tools-plugandpaint-app-example.html and its working fine there

                  LIBS += "/home/uidm9805/Qt Projects/plugandpaint/build/plugandpaint/plugins/libpnp_basictools.a"
                  

                  don't know why this project is behaving in odd manner

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #10

                  @NIXIN Is your plug-in really located here: /home/uidm9805/Qt Projects/static_plugin_qmake/build/plugin_qmake? And was it build with exact same compiler and Qt version?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  NIXINN 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @NIXIN Is your plug-in really located here: /home/uidm9805/Qt Projects/static_plugin_qmake/build/plugin_qmake? And was it build with exact same compiler and Qt version?

                    NIXINN Offline
                    NIXINN Offline
                    NIXIN
                    wrote on last edited by
                    #11

                    @jsulm yes plugin is located in the given path and compiler versions are same

                    1 Reply Last reply
                    0
                    • NIXINN Offline
                      NIXINN Offline
                      NIXIN
                      wrote on last edited by
                      #12

                      can anybody help me with this issue??

                      1 Reply Last reply
                      0
                      • NIXINN Offline
                        NIXINN Offline
                        NIXIN
                        wrote on last edited by
                        #13

                        After lot of hit and trial, I got the mistake I was doing

                        Q_IMPORT_PLUGIN(plugin_qmake)
                        

                        this line should have the class name of plugin

                        Q_IMPORT_PLUGIN(PluginQmake)
                        

                        now it works fine....

                        1 Reply Last reply
                        2
                        • Ni.SumiN Offline
                          Ni.SumiN Offline
                          Ni.Sumi
                          wrote on last edited by
                          #14

                          If it's solved, Please set it to "Solved" from unsolved.

                          1 Reply Last reply
                          1

                          • Login

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