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. plugin uses incompatible Qt library

plugin uses incompatible Qt library

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 3.8k 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.
  • J Offline
    J Offline
    JimK
    wrote on last edited by
    #1

    I am trying to build my first custom widget in Qt Creator 8.0.2 based on Qt 6.3.2 on Windows 10.
    I got it to build and install.
    I used the MS Visual C compiler and did a Release build because I read somewhere that it was needed for plugin dll's.
    In the .pro file I had to comment out the $target.path and change it to C:/Qt/Tools/QtCreator/bin/plugins/designer so "make install" would install in the correct directory for Qt Creator.
    When I go to Tools -> Form Editor -> About Qt Designer Plugins, I get the following error:

    The plugin 'C:/Qt/Tools/QtCreator/bin/plugins/designer/PMWidgetPlugin.dll' uses incompatible Qt library. (6.4.0) [release]

    Does anyone know what I'm doing wrong?

    Christian EhrlicherC 1 Reply Last reply
    0
    • J JimK

      I am trying to build my first custom widget in Qt Creator 8.0.2 based on Qt 6.3.2 on Windows 10.
      I got it to build and install.
      I used the MS Visual C compiler and did a Release build because I read somewhere that it was needed for plugin dll's.
      In the .pro file I had to comment out the $target.path and change it to C:/Qt/Tools/QtCreator/bin/plugins/designer so "make install" would install in the correct directory for Qt Creator.
      When I go to Tools -> Form Editor -> About Qt Designer Plugins, I get the following error:

      The plugin 'C:/Qt/Tools/QtCreator/bin/plugins/designer/PMWidgetPlugin.dll' uses incompatible Qt library. (6.4.0) [release]

      Does anyone know what I'm doing wrong?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @JimK said in plugin uses incompatible Qt library:

      Does anyone know what I'm doing wrong?

      You need to compile your plugin against the Qt version QtCreator 8.0.2 is built with.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • J Offline
        J Offline
        JimK
        wrote on last edited by
        #3

        << Sorry in advance for the strange formatting but I didn't try to format this message at all.>>

        OK.
        I downloaded Qt 6.3.2 and re-made it and the Widget now loads correctly in Qt Creator.
        THANK YOU!

        But when I try to use it, I can't link.
        It looks good in Designer.
        (I'm still using the MSVS compiler.)
        I copied the .lib file into the Source directory and right clicked on the .pro file to add the library.

        ==================================================================
        win32:CONFIG(release, debug|release): LIBS += -L$$PWD/./ -lPMWidgetPlugin
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/./ -lPMWidgetPlugind

        INCLUDEPATH += $$PWD/.
        DEPENDPATH += $$PWD/.

        But I still get the message:

        ===============================================================================================
        mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl PMWidget::PMWidget(class QWidget *)" (??0PMWidget@@QEAA@PEAVQWidget@@@Z) referenced in function "public: void __cdecl Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QEAAXPEAVQMainWindow@@@Z)

        The .lib file is very small. I don't see how it could have the object code in it. Does it somehow tell the linker to find the .dll at runtime?
        Why can't I link?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by ChrisW67
          #4

          The plugin for Designer (embedded in Qt Creator) must be built with the version of the Qt libraries that Qt Creator was built with. In your case this is Qt 6.3.2. This plugin provides the ability to visualise your widget in Designer.

          When you build a project that uses your widget then you need a version of your widget, not the Qt Creator plugin, built with the target Qt version for your project. Note that this will generally not be the same version as the one Qt Creator was built with. In your case it is probably Qt 6.4.0

          BTW, having the ability to visualise the widget in Designer (Qt Creator) is convenient but not essential. You can just insert a placeholder QWidget and use the Promote function to generate the correct code.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JimK
            wrote on last edited by
            #5

            I tried building everything with the same version of the tools but I still get the unresolved externals problem.
            It's like it's not linking in the library at all from the widget.

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              When you are building an application that uses your widget then the library file (*.lib) containing the PMWidget, not the Designer plugin, needs to be in a location that can be found on the linker search path, either a default location or somewhere specified in the -L option(s) in LIBS.

              J 1 Reply Last reply
              1
              • C ChrisW67

                When you are building an application that uses your widget then the library file (*.lib) containing the PMWidget, not the Designer plugin, needs to be in a location that can be found on the linker search path, either a default location or somewhere specified in the -L option(s) in LIBS.

                J Offline
                J Offline
                JimK
                wrote on last edited by
                #7

                I think I finally understand.
                The .lib or .a files that are output from the Designer Plugin build are completely worthless.
                I need to rebuild a project that turns the widget itself into a library and link with that.
                This means that there is a very big chance that the Designer plugin and the Widget Library will not be in sync.

                At any rate, I made a new project that makes a library with just the widget itself and I can link and run.

                Thank you.

                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